Search Unity

Bug [VideoPlayer][IOS][2019.4.31] Can't set time if streaming video from http

Discussion in 'Audio & Video' started by edupiacorp, Nov 19, 2021.

  1. edupiacorp

    edupiacorp

    Joined:
    Sep 22, 2021
    Posts:
    1
    Dear,
    We used Video player to play a video that is streamed from our server. This feature worked well on Unity 2019.3.13. Last week we update to Unity 2019.4.31 and then we get a bug with the video player. If we try to seek the video time then the video restart from the beginning. It happens only on IOS devices.

    Do anyone faced this issue?
     
  2. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi!

    Indeed, in 2019.4.24f1, a fix for another VideoPlayer issue has made it impossible to trigger a seek operation before the VideoPlayer is ready to play (for Apple platforms). By the time this specific problem scenario was discovered, the period of 2019.4 maintenance was over, which is why you're not seeing a fix present in the 2019.4 stream. The fix is present in 2020.3.6f1 however, if this is of any use in your context.

    I know upgrading to 2020.3 is probably not realistic, so in the mean time what you can do to work around the problem is to wait for the VideoPlayer to become prepared (by checking VideoPlayer.isPrepared, or adding a handler for the VideoPlayer.prepareCompleted event) before performing the seek operation. You would also need to avoid triggerring a seek operation if another seek operation is in progress (like setting VideoPlayer.frame or VideoPlayer.time a few times in rapid succession). You can witness the bug side-effects by looking at some of the VideoPlayer's properties like VideoPlayer.width, VideoPlayer.height or VideoPlayer.duration. During seek operations, these become 0, which is the source of the problem you're describing.

    Please let us know if this info helps you work around the problem.

    Sorry this is causing you grief; we've added better automated testing around this area so that these regressions won't happen in the future.

    Dominique Leroux
    A/V developer at Unity
     
  3. DominiqueLrx

    DominiqueLrx

    Unity Technologies

    Joined:
    Dec 14, 2016
    Posts:
    260
    Hi again!

    Actually let me correct something I said:

    The fix is in fact scheduled for backporting to 2019.4 and you can monitor the progress in here: https://issuetracker.unity3d.com/is...-dot-width-and-height-returns-expected-values

    Dominique