Video reloads and shows first frame after stop.

Workarounds and usability notes.

Video reloads and shows first frame after stop.

Postby John Robin Dove » Thu Aug 13, 2015 9:31 am

Hi Clifton,

I installed version 12.560 yesterday. Today I notice a change in the behavior of my program and am wondering if the new version has anything to do with it.

In my program the video file can be programmed by the user to start at 0 or at some later position if required. This works OK but I noticed that when the video started it always showed the first frame at 0 for a fraction of a second before moving on to the required start position. So I decided to hide the field (in which the video is displayed) when the video stops. The field which receives a continuous user event is shown again only if the currentTime > the desired start point. The field is still being hidden as planned but after about a second the first frame becomes visible even though the video has not been restarted. Any ideas please?
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Video reloads and shows first frame after stop.

Postby John Robin Dove » Fri Aug 14, 2015 8:44 am

Any thoughts about this? I suppose it's not a great problem but if a teacher doesn't want the video to start at the beginning it seems a bit unfortunate to show frame 0 and then jump to the start position when the play button is clicked.

There is no way that a video would visible in a field with its visible property set to false, right? So the only explanation must be that when the video loads it sends a user event with a currentTime value greater than the chosen start point because if the field containing the video is invisible the only way (according to my scripts) that it can become visible is by receiving a user event with a value in excess of the chosen start point. This worked until I updated to 12.560.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am

Re: Video reloads and shows first frame after stop.

Postby Clifton » Fri Aug 14, 2015 5:00 pm

First of all, please understand that streaming video must have received a video stream BEFORE it can seek to a point in the video. There are number of factors that govern the speed and success of seeking. Some mp4 videos store the meta data at the end of the video stream. These videos take a lot longer to seek to a specific point in the video. Conversion programs like Handbrake seem to do the best at converting videos and putting the meta data at the beginning of the stream. Nevertheless, the meta data stream must be read before seeking will occur. That is why the first few frames show before the video jumps to the required point.

Workarounds:
  1. Make sure your video includes a sequence of empty (black or white) frames at the beginning of the video.
  2. Add a black or white opaque overlay object on top of the video container while seeking. Then hide the overlay object after the seek has completed.
  3. Hide the video container momentarily and then show it after the video seek has finished. This appears to be the approach you have been using.
Regarding workaround 3: The latest release of the PowerPac (v12.560) introduced a forced show of the video container after 250ms if it was previously hidden. The reason was because recent releases of the Adobe Flash Player would fail to play the video if the container was not visible. The video in some cases would even fail to load. However, since this causes other issues (like in your case), we have chosen to remove the code that shows the video container and leave it up to the developer to decide how to manipulate things in their applications. The next release of the PowerPac will have this code disabled or removed.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Video reloads and shows first frame after stop.

Postby Clifton » Fri Aug 14, 2015 5:29 pm

UPDATE:
After running some tests, we will have to leave the code whenever the video container detects that Flash is being used to play the video. Reason is that allowing it be hidden causes other problems with Flash. HTML 5 video is not affected so we will not force visibility in these situations.
Clifton
Site Admin
 
Posts: 732
Joined: Tue Jan 14, 2014 1:04 am

Re: Video reloads and shows first frame after stop.

Postby John Robin Dove » Sat Aug 15, 2015 4:42 am

Thanks Clifton. I think using your workaround 2 will solve my problem.
John Robin Dove
 
Posts: 486
Joined: Thu Jan 23, 2014 4:35 am


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 3 guests

cron