vime-js / vime

Customizable, extensible, accessible and framework agnostic media player. Modern alternative to Video.js and Plyr. Supports HTML5, HLS, Dash, YouTube, Vimeo, Dailymotion...
https://vimejs.com
MIT License
2.78k stars 152 forks source link

bug: iOS HLS updating currentTime has no affect #232

Closed astev89 closed 3 years ago

astev89 commented 3 years ago

Bug Report

Vime version: @vime/svelte and @vime/core version 5.0.33

Provider: [X] HLS

Current behavior: Setting currentTime has no affect in iOS. The value can be changed, but it is not reflected in the video.

Expected behavior: When starting a video with on:vmPlay={() => currentTime = someNumber} the video should skip to the value provided.

Steps to reproduce: Use the vime svelte example code and add on:vmPlay and set the value to a function that updates the current time. It works in desktop browsers and androids, but not iOS.

-->

<Player
    muted
    controls
    bind:this={player}
    currentTime={$currentTime}
    on:vmPlaybackReady={onPlaybackReady}
    on:vmCurrentTimeChange={onTimeUpdate}
    on:vmFullscreenChange={onFullscreenChange}
    on:vmPlay={onPlayStart}
>
    <!-- Provider component is placed here. -->
    <Hls version="latest" config="{hlsConfig}">
        <source
            data-src="https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"
            src="https://bitdash-a.akamaihd.net/content/sintel/hls/playlist.m3u8"
            type="application/x-mpegURL"
        />
    </Hls>
    <DefaultUi />
</Player>

Other information: Adding the autoplay prop with playsinline has no affect, but doing so causes a loading indicator to play over the video without ever going away.

astev89 commented 3 years ago

After doing some recon I discovered that adding #EXT-X-START:TIME-OFFSET={NUMBER VALUE HERE},PRECISE=YES to the m3u8 playlist file will successfully update the default start time in iOS safari. Obviously it's not the players job to update said file so I'm just going to close it. Maybe this will help someone struggling with the same.