shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.19k stars 1.34k forks source link

Client side ads not playing in iOS fullscreen #6133

Closed Andekas closed 1 week ago

Andekas commented 9 months ago

Have you read the FAQ and checked for duplicate open issues? Yes

If the problem is related to FairPlay, have you read the tutorial?

Not related

What version of Shaka Player are you using?

Latest, 4.7.6

Can you reproduce the issue with our latest release version? Yes

Can you reproduce the issue with the latest code from main? Yes

Are you using the demo app or your own custom app? Demo app

If custom app, can you reproduce the issue using our demo app? Yes

What browser and OS are you using? iOS - Chrome, Safari, Firefox

For embedded devices (smart TVs, etc.), what model and firmware version are you using?

What are the manifest and license server URIs?

For content, any (demo) URL is good.

For ads I used Google IMA VMAP sample tags ( https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side/tags )

What configuration are you using? What is the output of player.getConfiguration()?

Default

What did you do?

Try to play video with ads

What did you expect to happen? Ads and video to play

What actually happened?

Ads work great when player is not in fullscreen.

On fullscreen, no ads are displayed. When going to fullscreen during an ad (rotating the device to landscape), the ad sound keeps playing but main video is visible (paused). If ad(s) end, video starts playing.

avelad commented 9 months ago

Are you interested in finding and create a PR to fix the error? Thanks!

Andekas commented 9 months ago

@avelad I'm afraid that I'm not that familiar with Apple devices. As I use Win/Android, it would be really difficult to debug also...

avelad commented 9 months ago

The fullscreen API is not available on iOS (https://caniuse.com/fullscreen) so we use the fullscreen API of the video element itself and it produces this behavior. I see two solutions:

Which solution do you like best? (You probably won't like any...)

Andekas commented 9 months ago

@avelad Thanks for looking it up!

I guess that the best solution would be to disable the fullscreen button / rotation during the ads, if fullscreen API is not supported.

In this case user is forced to see at least preroll. And if he goes to fullscreen after preroll and doesn't get any midrolls, it's acceptable. Exiting fullscreen to display ads is a really bad user experience, I would say.

avelad commented 9 months ago

@theodab What do you think?

PradeepK17 commented 9 months ago

@Andekas @avelad Please look this blog - IMA iOS10+ customPlayback. It may provide insights on how to address the problem.