shaka-project / shaka-player

JavaScript player library / DASH & HLS client / MSE-EME player
Apache License 2.0
7.12k stars 1.33k forks source link

The video subelement track is deleted #7080

Closed dsyscms closed 2 months ago

dsyscms commented 2 months ago

`

`

The track element will not be deleted when the video is played for the first time

When switching video streams(manifestUri address is different), the track element is deleted.

await player.load(manifestUri);

avelad commented 2 months ago

It’s the expected behavior, why do you need it?

dsyscms commented 2 months ago

Subtitles rely on track elements,The track element is deleted, which causes the element to be not found, thus affecting the loading of subtitles <track default="" kind="metadata" src="blob:http://localhost:3000/1daf4b3a-2f94-4065-b22a-bd164347fc6f">

avelad commented 2 months ago

We have an API to add external subtitles: addTextTrackAsync , you need use it.

dsyscms commented 2 months ago

The project must use the track element because the subtitle function has been implemented. Since deletion is the expected behavior, why is it not deleted the first time it is called?

avelad commented 2 months ago

Because the player doesn’t support mix internal text tracks and video tracks

dsyscms commented 2 months ago

If possible, please keep it and don't delete it. Many people use shaka-player mainly to replace dash.js Generally, only shaka-player is needed to provide dash format video playback function