Summary
I am trying to play a song starting at a non-zero starting position. For example, I would like to play a song starting at 10 seconds instead of at 0 seconds.
Approach
Expected results
The song should start playing at 10 seconds.
Actual results
~4 out of every 5 times it works as expected.
~1 out of every 5 times I get the following error:
See also the full error log attached:
Further Impact
The error that is being thrown does not create an mediaPlaybackError event, so I can't even handle the error properly in my application logic.
I am trying to play a song starting at a non-zero starting position. For example, I would like to play a song starting at 10 seconds instead of at 0 seconds.
Approach
setQueue
play
seekToTime
Code Block let music = window.MusicKit.getInstance(); // 1: setQueue music.setQueue({ song: "validSongID" }) .then(() => { // 2: play music.player.play() .then(() => { // 3: seekToTime const position = 10; music.player.seekToTime(position); }); });
Expected results
The song should start playing at 10 seconds.
Actual results
~4 out of every 5 times it works as expected.
~1 out of every 5 times I get the following error:
Code Block Uncaught (in promise) TypeError: Failed to execute 'remove' on 'SourceBuffer': The end value provided (0) must be greater than the start value provided (0).
See also the full error log attached:
Further Impact
The error that is being thrown does not create an mediaPlaybackError event, so I can't even handle the error properly in my application logic.