Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

IOS Safari Video Player with Sound: How to start play without an error? After bug fix 2020.3.16

Discussion in 'WebGL' started by vinodlobo, Aug 21, 2021.

  1. vinodlobo

    vinodlobo

    Joined:
    Dec 3, 2019
    Posts:
    10
    We are trying to get the VideoPlayer working on iOS Safari after the bug fix in 2020.3.16:
    https://issuetracker.unity3d.com/issues/webgl-ios-video-is-not-playing-on-ios

    So far, video plays when muted. If we start play on an unmuted video with a Unity button (sprite with on click event attached that calls video.play()), this causes the Safari javacript error "NotAllowsError ... user denied permission. play@[native code] _JS_Video_Play. Note: we do not autoplay, but only play after pressing a Unity button.

    The same build plays video on desktop browsers including Safari and Android Chrome, etc.

    Is there a way to trigger a video with sound from a button press in Unity that will work in iOS Safari? Any other workarounds?

    Thanks, Vinod
     
  2. Marks4

    Marks4

    Joined:
    Feb 25, 2018
    Posts:
    494
  3. vinodlobo

    vinodlobo

    Joined:
    Dec 3, 2019
    Posts:
    10
    Thanks @Marks4, will check it out. We would prefer a single solution for our three target platforms (WebGL, iOS, Android apps) which the native video player handles (except for Safari). Note: I've also had issues with Desktop Safari playing the video -- Apple keeps changing things!

    On a related note: does your asset allow closed captions or subtitles to show in the video for accessibility? From what I understand Unity video player does not support this, a requirement for many use cases.

    - Vinod