bitmovin / bitmovin-player-ui

The Bitmovin Adaptive Streaming Player UI

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bleacherreport.com - impossible to go to exit fullscreen

karlcow opened this issue · comments

Steps to reproduce:

  1. With Safari Technical Preview 170
  2. Navigate to https://bleacherreport.com/
  3. Enter fullscreen on a video
  4. Attempt to exit fullscreen from onscreen controls (bottom right)

The code on the bleacherreport.com is not too bad, but then it becomes hard to decipher when inside bitmovin code because of the obfuscation. I'm trying to understand on which side is the issue.

My hunch is not that much that it can't exit fullscreen, but that something it doesn't change state to signal it is in fullscreen. It's why the icon stays as is.

e.on(e.exports.PlayerEvent.ViewModeChanged, (
    function() {
        e.getViewMode() === e.exports.ViewMode.Fullscreen 
            ? i.addClass(o.prefixCss(t.FULLSCREEN)) 
            : i.removeClass(o.prefixCss(t.FULLSCREEN))
        })),
e.getViewMode() === e.exports.ViewMode.Fullscreen && i.addClass(this.prefixCss(t.FULLSCREEN))

e.getViewMode() returns inline

When it goes to https://static-assets.bleacherreport.net/js/vendors~bitmovin-player-31cd1af0.js
It's… well… more difficult 😉

Hi @karlcow,

As you noticed, this isn't really a UI but a player issue, hence I'm closing this ticket in the UI repository.

Having said that, this is a known issue caused by a Safari bug behavior change around the events of the underlying fullscreen API. We have already implemented a mitigation for this problem in our player, which will be part of the upcoming release next Tuesday (8.119.0).

Thanks a lot @dweinber
Do you know which Safari bug? on bugs.webkit.org?

Sorry, I got that slightly wrong. It's not a bug in Safari but a behavior change in the fullscreen-related events. I think from Safari it's expected behavior but this change messed with our state handling.

@dweinber Hi! Can I get more precision into why it messed up the state handling? Knowing what the fix you applied would be helpful too. I'm wondering if there are any more cases that started breaking with the new fullscreen API or if it's just isolated.

Hi @nt1m,

Essentially our player was listening to prefixed and unprefixed fullscreen change events to support the different browsers and implementation. So far, browsers had one or the other but starting with Safari 16.4, Safari emits both, fullscreenchange and webkitfullscreenchange events.

This caused the player to think it has left fullscreen mode already, even though it was still playing fullscreen. Hence, the button to de-toggle fullscreen didn't work.

With the player version 8.119.0 and above, we now remember which event type has triggered the fullscreen mode, leading to interleaving events (like webkitfullscreenchange) not having an effect on the state in the player.

Thanks! that helped us provide a fix on our side as well: WebKit/WebKit#14599

Nice, thanks for letting us know and for implementing the fix! 👍