# \[IGN-6512\]Perspective Video Player and large files not loading

**URL:** <https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461>\
**Category:** Ignition\
**Tags:** perspective\
**Created:** [August 25, 2022, 4:34pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461 "2022-08-25T16:34:19Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericmoulton](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@ericmoulton](https://forum.inductiveautomation.com/u/ericmoulton)\
**Post date:** [August 25, 2022, 4:34pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/1 "2022-08-25T16:34:19Z")

</div>

Hi,  
We have a Webdev mounted network folder serving up mp4 files to Perspective sessions using the Video Player component. Users record and upload videos and then other users watch them later.

When the user clicks a video link, the video begins loading and eventually is ready to play. It works great on a computer with Chrome with any size file, it works ok on my newer-gen Samsung phone, and larger videos (~300mb) don’t ever load on our company ipads. The smaller videos load ok but the larger ones just load and load forever.

Is there a way to begin playing once the video is partially loaded (the way youtube does with buffering)?

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 25, 2022, 4:52pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/2 "2022-08-25T16:52:34Z")

</div>

It would be _possible_ (but quite a bit of effort) to do this using a Python webdev endpoint, but this is definitely something we should do better first-party.

If you don’t mind the drawbacks (e.g. inflated project size), the _file_ webdev resource type _does_ implement range requests, which should give you a much better experience with videos.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 25, 2022, 5:52pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/3 "2022-08-25T17:52:47Z")

</div>

Consider using a segmenting tool like `ffmpeg` to break your video into fragments a few seconds long with a “playlist” file as the actual URL. Modern players will grab the fragments intelligently, yielding superior performance even with pause/rewind/forwarding operations.

---

<div class="post-metadata">

**Author:** ![ericmoulton](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@ericmoulton](https://forum.inductiveautomation.com/u/ericmoulton)\
**Post date:** [August 25, 2022, 6:07pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/4 "2022-08-25T18:07:02Z")

</div>

Are you saying we could mount a file directly through webdev to increase performance?  
If so, can that be done dynamically every time a video is uploaded?  
Could we unmount them as needed also?

We’re making sort of a company Youtube for training videos.

---

<div class="post-metadata">

**Author:** ![ericmoulton](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@ericmoulton](https://forum.inductiveautomation.com/u/ericmoulton)\
**Post date:** [August 25, 2022, 6:07pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/5 "2022-08-25T18:07:58Z")

</div>

That is a really cool idea. I wish we could do it all natively in ignition vs adding external resources and scripting and the maintenance that goes along with that, but that’s a cool idea.

---

<div class="post-metadata">

**Author:** ![paul-griffith](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/paul-griffith/32/37249_2.png) [@paul-griffith](https://forum.inductiveautomation.com/u/paul-griffith)\
**Post date:** [August 25, 2022, 6:08pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/6 "2022-08-25T18:08:43Z")

</div>

The file resource type can’t be created dynamically, but _does_ return content-range headers.  
So it would work ‘properly’ as far as returning the right values, but is too limited in other ways.

The only way to have both flexibility _and_ content-range headers at present is a Python endpoint. Or to script your upload process to do what Phil mentioned.

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 25, 2022, 6:10pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/7 "2022-08-25T18:10:35Z")

</div>

> [@ericmoulton](#):
>
> I wish we could do it all natively in ignition

Ignition could call out to `ffmpeg` with ProcessBuilder to run the segmenting process after upload. Such a process could also load the fragments and playlist into database blobs to make it compatible with my Blob Server module.

---

<div class="post-metadata">

**Author:** ![ericmoulton](https://avatars.discourse-cdn.com/v4/letter/e/a88e57/32.png) [@ericmoulton](https://forum.inductiveautomation.com/u/ericmoulton)\
**Post date:** [August 25, 2022, 6:42pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/8 "2022-08-25T18:42:00Z")

</div>

Can you point me to a link about ProcessBuilder? I’ve never heard of it and I don’t see it in ignition help or on top forum search results.

I see the word in the Java docs, but is there any documentation more specifically about integrating it into ignition?

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 25, 2022, 7:10pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/9 "2022-08-25T19:10:52Z")

</div>

> [@ericmoulton](#):
>
> integrating it into ignition?

Ignition's jython can use java classes pretty much just like native jython.

In a script:

```auto
from java.lang import ProcessBuilder

def someFunction():
    myProcess = ProcessBuilder().command('ffmpeg', '-i', 'inputFile', ....).start()
...

```

[Java docs](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ProcessBuilder.html).

---

<div class="post-metadata">

**Author:** ![jfan](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@jfan](https://forum.inductiveautomation.com/u/jfan)\
**Post date:** [July 18, 2023, 3:52pm UTC](https://forum.inductiveautomation.com/t/ign-6512-perspective-video-player-and-large-files-not-loading/63461/10 "2023-07-18T15:52:21Z")

</div>

Hi Paul, any idea why video won't play on mobile devices with file resource? tried both IOS and Android. But when I used the source path on the mobile browser, it played automatically.

Appreciate any help!
