htmlVideoLoader() and error messages

Help for using specific functions

htmlVideoLoader() and error messages

Postby Kataleena » Wed Sep 10, 2014 2:08 am

Hi,

I’m using htmlVideoLoader() and hosting my videos on a separate server(CDN) from my Toolbook content. A few times I have had trouble loading the videos. The error message is similar to “We are unable to connect to the content you've requested. We apologise for the inconvenience".

My videos are set to auto load when the page is entered and go to next page, at end of video with no controls.

1. Is it possible to edit the error message?
2. I have seen on other videos I have viewed on the internet a load or reload button when the video couldn't be connected too. Is this possible?
3. Is there a way to get it to keep checking for the video rather then throwing the error message?

Thanks
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: htmlVideoLoader() and error messages

Postby Clifton » Wed Sep 10, 2014 7:50 am

We can hook into the video player on error event, but the current version of the PowerPac only does this in very isolated instances.

However, as a workaround you could try using pgTimer() right after the video loads. This function will send a user event to any object at timed intervals. When the user event is received, you can check the play head position of the video. It after several attempts the value is null or empty, then assume a failed connection and either display a reload button or automatically have the action attempt to reload the video. If you do this you must remember to stop pgTimer() notifications to save CPU cycles and possible anomalies. I would start with a rather long periodic timer like 1200ms and see how that works.

I've used this method in other types of situations and it works very well.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: htmlVideoLoader() and error messages

Postby Kataleena » Tue Jan 05, 2016 11:37 pm

Hi,

I know this is an old thread but I'm not sure I ever got this to work properly with using your suggestion. I'm having multiple different issues and IE and Chrome are handling it differently.

I was wondering if you could show me an example of how you would get this to work.? I want the video to be automatically reloaded if there is an issue or the connection is lost and continue to do so till its playing again, I have no controls on my videos, the user is forced to watch it from start to finish before they advance to the next page.

Thanks for your help.
Kataleena
 
Posts: 49
Joined: Sun Feb 23, 2014 10:05 pm

Re: htmlVideoLoader() and error messages

Postby Clifton » Wed Jan 06, 2016 12:11 am

If the video stalls because of connection stability, could you just put a button for the user to reload the video?

If not, then the automatic detection approach in this topic may work but I don't have an example at the moment. I can try and put something basic together.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: htmlVideoLoader() and error messages

Postby Clifton » Wed Jan 06, 2016 1:24 pm

You can give this a try: (requires an HTML 5 browser)
    Here is the actual exported result:

What does this do?
Answer: When the page loads, a trigger is sent to the video player field to load the video. We set the video monitor to "continuous" so we have playback tracking. If the continuous monitor detects the video has stalled for 20 seconds, it issues an automatic reload (or trigger) back to the video player field. If you are using time markers, however, you will probably have to use pgTimer() instead of the continuous monitor of the htmlVideoLoader() function. In the above example, the red field is used to show the video playhead progress. If at any time it stalls, then the system will wait up to 20 seconds for it to begin playing again. If that doesn't happen, then it will trigger the video player field to reload the video and start it from the beginning.

Steps to Reproduce
  1. Define a global variable called videoStream and initialize it as an array.
  2. Draw a field and name it "VideoPlayer"
  3. Draw a button and leave it unnamed. Set the caption to "Reload" and place an on click action on this button to trigger the field "VideoPlayer"
  4. Draw a field and name it "Events"
  5. Add these actions to the on load page action of the field "VideoPlayer"
      onFirstIdle.png
      on load page actions
      onFirstIdle.png (50.24 KiB) Viewed 10873 times
  6. Add these actions to the on trigger action of the field "VideoPlayer"
      onTrigger.png
      onTrigger actions
      onTrigger.png (56.2 KiB) Viewed 10863 times
  7. Add these actions to the on user event of the field "VideoPlayer"
      onUserEvent.png
      on user event actions
      onUserEvent.png (35.27 KiB) Viewed 10863 times
      Here is a detail of the pgAnimateCSS() parameters. Once the continuous monitor begins recording playhead movement, we can fade in the video player using this function.
      pgAnimateCSS.png
      pgAnimateCSS Parameters
      pgAnimateCSS.png (57.61 KiB) Viewed 10863 times
  8. Export and try it out on an unstable connection.
    I couldn't actually test this because I couldn't simulate a stalled video stream.
Let us know what you end up doing to get it to work in your particular application!
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am


Return to Function Help

Who is online

Users browsing this forum: No registered users and 2 guests

cron