shaka-project / shaka-player

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

Function selectTextTrack not work when upgrade version from 4.0.2 to 4.6.2 #5977

Closed vanminhquangtri closed 10 months ago

vanminhquangtri commented 10 months ago

Have you read the Tutorials? Yes I did

Have you read the FAQ and checked for duplicate open issues? Yes

What version of Shaka Player are you using? 4.6.2 https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.6.2/shaka-player.compiled.min.js https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.6.2/shaka-player.ui.min.js

Please ask your question

On version 4.0.2, the functions for switch subtilte worked well. But when I change to version 4.6.2, it not runs. Player also not throw any error. Please give me instruction how to do it correctly. This is my code:

player.selectTextTrack(track)
player.selectTextLanguage(track.language)
player.setTextTrackVisibility(true)

Thank you

avelad commented 10 months ago

I tested on the main branch and on 4.6.3 with the demo and it works. Can you share your manifest to see what happens? Thanks!

vanminhquangtri commented 10 months ago

@avelad thanks. This is my manifest content:

avelad commented 10 months ago

There was a problem in 4.6.2 and it has been fixed in 4.6.3 (see https://github.com/shaka-project/shaka-player/releases/tag/v4.6.3) please update to 4.6.3 and tell me if it works correctly for you.

vanminhquangtri commented 10 months ago

@avelad thanks it works. But there another problem that the duration time it somehow overlap the progress bar. I already read the docs but there no option to choose show the current time only. Can you please advise me if we have any methods/configure to do remove this? Thanks image

avelad commented 10 months ago

That UI is not the one provided by Shaka, so we cannot help you with this. Sorry!

vanminhquangtri commented 10 months ago

Hello @avelad as I checked from your library file, I need to remove this part so that the duration not shown. But modifying library directly like this is not good.

https://cdnjs.cloudflare.com/ajax/libs/shaka-player/4.6.3/shaka-player.ui.min.js

The code I removed is:

" / "+t1(i,e)

image

nhutuan99 commented 10 months ago

You save mylife, awesome 👍 🥇