Page 1 of 1

Unable to hide video on Chrome

PostPosted: Thu Jun 07, 2018 9:06 am
by John Robin Dove
Hi Clifton,

This is not vital but I would prefer not to let the student see the first frame of the video before it starts. If I hide the TB field it makes no difference. On Firefox I can achieve what I want by placing an object on top of the video field but on Chrome even this fails to hide it. I've tried changing object layers but that doesn't work either.

John

Re: Unable to hide video on Chrome

PostPosted: Thu Jun 07, 2018 10:56 am
by Clifton
I tried a sample using the PowerPac htmlVideoLoader() and hiding the video worked fine until the video reached a designated playhead position.
Example:
  1. Created new empty PowerPac-enabled book with default export options.
  2. Drew a field and name it "VideoPlayer"
  3. On load page … I set these actions for the field "VideoPlayer":
      Image 1.png
      On load page for field "VideoPlayer"
      Image 1.png (16 KiB) Viewed 1229 times

  4. Created a user event to show the "VideoPlayer" after 5000ms:
      Image 2.png
      On User event actions.
      Image 2.png (2 KiB) Viewed 1229 times

  5. Added an mp4 called waterdrop.mp4 to the media folder using the DHTML Export utility.
  6. Exported file and ran it using the PowerPac server and it played as expected in all browsers. The field "VideoPlayer" was hidden until the video got to 5000ms and then it was shown for the remaining time. The only anomaly was that the controls were visible as the video played during the first 5 seconds, but that is not unusual as the controls are not actually embedded in the field.
If you are using a different video player, maybe that is a factor?
 

Re: Unable to hide video on Chrome

PostPosted: Thu Jun 07, 2018 12:33 pm
by John Robin Dove
No, I'm using the Powerpac htmlVideoLoader. I do not show the control's as I have my own. I load the video and prepare other aspects of the exercise according to the configuration chosen by the teacher. The video does not start until the user clicks on a play button. As I said, I hide the video with a field until it starts playing and this works with Firefox but strangely not with Chrome. I'll try again tomorrow.

Re: Unable to hide video on Chrome

PostPosted: Thu Jun 07, 2018 1:24 pm
by Clifton
You shouldn't need a field to cover the video. Just hide the field that acts as the container. That is all I did in my experiment. I also tried this with or without controls.

If you still have trouble, maybe post an example that fails for you and we can take look.

An alternative to hiding the field is to set the opacity of the field to 1 using setOpacity(). This makes the video visible to the page, but basically invisible to the user. Then at 1000ms, or whatever time frame you choose, set the opacity of the container field back to 100, which removes the opacity filter and makes it fully visible.
 

Re: Unable to hide video on Chrome

PostPosted: Thu Aug 23, 2018 9:04 am
by Lobdell
The opacity workaround is quite neat. I had no idea you could do that. Is there possible to make it apply automatically every time somehow?

Re: Unable to hide video on Chrome

PostPosted: Fri Nov 23, 2018 6:58 am
by Nadene
Clifton wrote:I tried a sample using the PowerPac htmlVideoLoader() and hiding the video worked fine until the video reached a designated playhead position.
Example:
  1. Created new empty PowerPac-enabled book with default export options.
  2. Drew a field and name it "VideoPlayer"
  3. On load page … I set these actions for the field "VideoPlayer":
      Image 1.png

  4. Created a user event to show the "VideoPlayer" after 5000ms:
      Image 2.png

  5. Added an mp4 called waterdrop.mp4 to the media folder using the DHTML Export utility.
  6. Exported file and ran it using the PowerPac server and it played as expected in all browsers. The field "VideoPlayer" was hidden until the video got to 5000ms and then it was shown for the remaining time. The only anomaly was that the controls were visible as the video played during the first 5 seconds, but that is not unusual as the controls are not actually embedded in the field.
If you are using a different video player, maybe that is a factor?
 


Thank you for this answer, I had the same problem!