Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

iPad Only (v16.4 and Safari) "NotAllowedError" multi-stream mp4VideoFormat play() #323

Open
karendolan opened this issue Sep 11, 2023 · 5 comments

Comments

@karendolan
Copy link
Contributor

karendolan commented Sep 11, 2023

The iPad is throwing a Unhandled Promise Rejection: NotAllowedError: The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission. on https://github.com/polimediaupv/paella-core/blob/main/src/js/videoFormats/es.upv.paella.mp4VideoFormat.js#L42-L46

Test with multi-video https://paellaplayer.upv.es/player.html?id=belmar-multiresolution-remote

This is not happening from iPhone, only from the iPad.
This is not happening from a single video in the iPad, only multiple videos.

It appears to be a too early call for the video to play that is rejected by the browser.
I suspect that the waitForLoaded() is having difficulty telling when both videos are ready to play in an iPad. However, it's odd that the issue does not also happen in an iPhone.

@karendolan
Copy link
Contributor Author

Related... even though that error is throw, the video does play IF iPad is using native HLS. If iPad is using HLS.js, the code halts at the second video.play() in that second promise of the multi-video load.

Frustratingly... even though setting forceNative = true in the player's config.json solves the multi-video load issue for iPad, the Android/Chrome also responds with "maybe" to video.canPlayType('application/vnd.apple.mpegurl'). Then, Android/Chrome throws an error when the m3u8 is attempted in it's native HLS.

Our current attempt at a workaround is to forceNative on iOS devices only, in order to support native HLS multi-video on iPad and HLS.js on Android/Chrome.

karendolan added a commit to karendolan/paella-core that referenced this issue Sep 22, 2023
…revent forcing Android/Chrome to native HLS
karendolan added a commit to karendolan/paella-core that referenced this issue Sep 22, 2023
…revent forcing Android/Chrome to native HLS
@karendolan
Copy link
Contributor Author

karendolan commented Dec 15, 2023

FYI - our site is working around this and a few other iPad difficulties by forcing the native browser HLS player instead of allowing HLS.js when using an iPad for both single and multiple-video events.
We will revisit this issue when/if we separate the audio from the video files in our published multiple-videos events.

@karendolan
Copy link
Contributor Author

iPad OS v17 seems to have less of an issue using HLS.js for multiple videos. But iPad OS v16 consistently errors out attempting to use HLS.js to load multi-videos at our site.

Do you have a recommendation on how to just isolate the iPad for dual stream videos when checking if it should force native without impacting Androds and other devices that can are able to run dual videos in HLS.js?

Our current workaround is to just force all iOS to run HLS natively, which is non-optimal.

@miesgre
Copy link
Collaborator

miesgre commented Jun 12, 2024

We currently do not have any iPad v16 and cannot test the issues with HLS.js.

But I don't understand what you want to do.

  • Force all iOS to native?
  • iPad all dual videos to native?
  • iPad v16 to native?

Can you explain it to me?

@karendolan
Copy link
Contributor Author

@miesgre, None of the 3 options are ideal. Ideally, catching that "NotAllowedError" when attempting multi-video with HLS.js, then testing and forcing native HLS is the most general. It also seems complicated to implement.

In the interim, our site took the easy 4-lines-of-code option (via an HLS plugin override) of forcing all iPads to use native HLS instead of HLS.js until our next upgrade. By then iPadOS v16 should be long gone.

Feel free to close this issue as "won't do" and leave it as informational.


  1. Force all iOS to native?

Pros:

  • Avoids the crash when iPadOSv16 attempts to run HLS.js on 2+ videos
  • Provide's the same play experience for single video and multi-video events
  • Removes the ambiguity of when iPadOS will work and when it will not work.

Cons:

  • Single video events play better in HLS.js in iPadOSv16
  • iPadOSv16 is an older version, why bother supporting it.

  1. iPad all dual videos to native?

Pros:

  • It targets the issue for iPadOS and dual videos
  • Covers the issue if it also appears in some other iOS that we don't know about

Cons:

  • Gives a different experience when running single video versus dual+ videos
  • Forces iPadOSv17 to use native when it appears to support dual video in HLS.js Ok
  • Blanket behavior for all iOS, when the issue appears to be specific to iPadOS

  1. iPad v16 to native?

Pros:

  • Targets the problematic iPadOS version
  • Gives same experience for single & multi events for students using iPadOSv16

Cons:

  • Targets an older version of iPadOS, why bother supporting older versions?
  • Code is very specific and sets precedence for supporting specific versions of device OS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants