Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: beyondwords-io/player
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 0.2.7
Choose a base ref
...
head repository: beyondwords-io/player
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0.2.8
Choose a head ref
  • 2 commits
  • 11 files changed
  • 1 contributor

Commits on May 16, 2024

  1. Fix mid-roll adverts on iOS

    This was very difficult to diagnose and fix. Basically, one of our
    customers reported that mid-roll adverts were causing the player to
    become paused after playing. The browser was throwing a NotAllowedError.
    
    Initially, I thought this because the player had been idle for
    potentially several minutes before the mid-roll advert played, and when
    it reverted back to the original track, a NotAllowedError was thrown 
    because there hadn’t been a recent user interaction.
    
    However, after googling a lot, I couldn’t find anyone else experiencing
    this problem with Google’s IMA SDK. Furthermore, it was pointed out that
    apps such as YouTube are able to interrupt playback to play adverts and
    resume again afterwards without requiring a user interaction.
    
    Today I figured out that the root cause of the problem is that we are
    recreating the <video> element when the sources change. The browser sees
    a different DOM element which has received no user interaction and it
    therefore throws a NotAllowedError. By reusing the same <video> element,
    the problem goes away.
    
    However, that exposed some other bugs with VAST playback on iOS:
    
    1) The advert kept looping. This was fixed by realising that the IMA SDK
    also changes the video’s currentSrc and because we were setting our own
    video.sourceUrl in loadMedia, the `wrongSource` boolean was always false
    meaning that `video.reload()` was not being called.
    
    2) After the advert played, the audio was resuming from the wrong place.
    This was fixed with `setDisableCustomPlaybackForIOS10Plus(true)` based
    on some advice from a bug report: https://groups.google.com/g/ima-sdk/c/SzUfZ6Yckzw
    I traced the player events for a while to try and understand where it
    was going wrong. It seems like IMA SDK sets video.currentTime even after
    the source has been reloaded, which seems wrong.
    
    Unfortunately, we’ll need to find another way to solve this problem:
    https://linear.app/beyondwords/issue/S-3698/try-to-recreate-the-video-element-when-the-player-identifiers-are
    tuzz committed May 16, 2024
    Configuration menu
    Copy the full SHA
    c72ceb4 View commit details
    Browse the repository at this point in the history
  2. Release version 0.2.8

    tuzz committed May 16, 2024
    Configuration menu
    Copy the full SHA
    b18c93d View commit details
    Browse the repository at this point in the history
Loading