videojs / video.js

Video.js - open source HTML5 video player
https://videojs.com
Other
38.07k stars 7.45k forks source link

Bigplay button on videojs Click event is not fired on IOS #8293

Open prakash-bbsr opened 1 year ago

prakash-bbsr commented 1 year ago

Description

I'm working on the IMA SDK plugin (http://googleads.github.io/videojs-ima/). We need to initialize the SDK as the result of a user action. Ideally this would be the same user action that starts the video. In all other platforms we listen for the first click on the video and initialize our SDK on that action, but that's not possible on iPhone because we can't capture that first click.

Particularly in IOS device without user action the ads is not playing. It is playing either mutu or set volume 0.

Reduced test case

https://codepen.io/pcn2007/pen/abRxyYr?editors=1010

Steps to reproduce

  1. Trying to initialise Google IMA SDK initialise after clicking on the big play button.
  2. Bigplay button event is not firing on iPhone devices.

Errors

player.bigPlayButton.on('click', function(){ // do the action });

Event is not fired.

What version of Video.js are you using?

https://unpkg.com/@videojs/http-streaming@2.16.2/dist/videojs-http-streaming.js and //imasdk.googleapis.com/js/sdkloader/ima3.js

Video.js plugins used.

video.js@7.10

What browser(s) including version(s) does this occur with?

Iphone Safari

What OS(es) and version(s) does this occur with?

Ios 16.3.1

prakash-bbsr commented 1 year ago

Hi Gary Katsevman, player.bigPlayButton.on('touchstart', function(){

}); I have used the touch start event which is working not but the main problem is unable to play the Google IMA SDK ads on Ipone without unmute. As per the document using the user touch event we can play. Could you please guide me to play vast ads using videos and Google IMA SDK for IOS devices? I have checked separately using html5 video tag without using videojs, it is working on iPhone after clicking on the particular button. Is there any limitation of videojs with an IOS device?

danrossi commented 1 year ago

This works

player.ready(function () {
                    const playBtn = player.getChild("BigPlayButton");
                    playBtn.on(['tap', 'click'], onIOSClick);
                });