Joel2B / Custom-Video-Player

HTML5 Video Player, based on Fluid Player v3.0.4
https://appsdev.cyou/player/demo/
MIT License
14 stars 8 forks source link

Audio track and subtitles tracks label mapping incorrectly #11

Open Hardikverma opened 6 days ago

Hardikverma commented 6 days ago

A clear and concise description of what the problem is.

subtitles and audio tracks label mapping issue like in the screenshot below. Additional context Add any other context or screenshots about the request here.

image image

my hls/m3u8 stream is as following example

## Generated with https://github.com/google/shaka-packager version v2.4.3-dd9870075f-release

#EXT-X-STREAM-INF:BANDWIDTH=1602390,AVERAGE-BANDWIDTH=492564,CODECS="avc1.640028",RESOLUTION=640x360,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_360_high_750k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=971486,AVERAGE-BANDWIDTH=318114,CODECS="avc1.640028",RESOLUTION=480x270,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_270_high_500k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=331258,AVERAGE-BANDWIDTH=142221,CODECS="avc1.640028",RESOLUTION=256x144,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_144_high_60k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=598395,AVERAGE-BANDWIDTH=189758,CODECS="avc1.640028",RESOLUTION=320x180,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_180_high_235k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=8734900,AVERAGE-BANDWIDTH=3048280,CODECS="avc1.640028",RESOLUTION=1920x1080,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_1080_high_5800k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=2439783,AVERAGE-BANDWIDTH=721162,CODECS="avc1.640028",RESOLUTION=852x480,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_480_high_1750k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=740466,AVERAGE-BANDWIDTH=237627,CODECS="avc1.640028",RESOLUTION=384x216,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_216_high_375k.m3u8
#EXT-X-STREAM-INF:BANDWIDTH=4400704,AVERAGE-BANDWIDTH=1320150,CODECS="avc1.640028",RESOLUTION=1280x720,FRAME-RATE=25.000,AUDIO="audio",SUBTITLES="subtitle"
h264_720_high_3000k.m3u8

#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_128000_0_96.m3u8",GROUP-ID="audio",LANGUAGE="hi",NAME="stream_0",DEFAULT=YES,AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_128000_3_96.m3u8",GROUP-ID="audio",LANGUAGE="te",NAME="stream_3",AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_128000_2_96.m3u8",GROUP-ID="audio",LANGUAGE="ta",NAME="stream_2",AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=AUDIO,URI="audio_128000_1_96.m3u8",GROUP-ID="audio",LANGUAGE="bn",NAME="stream_1",AUTOSELECT=YES,CHANNELS="2"
#EXT-X-MEDIA:TYPE=SUBTITLES,URI="subtitle_hin.m3u8",GROUP-ID="subtitle",LANGUAGE="hi",NAME="stream_1",DEFAULT=YES,AUTOSELECT=YES
#EXT-X-MEDIA:TYPE=SUBTITLES,URI="subtitle_eng.m3u8",GROUP-ID="subtitle",LANGUAGE="en",NAME="stream_0",AUTOSELECT=YES
Joel2B commented 6 days ago

hi, for now the player takes the attribute "NAME" of each source, in your case they start with "stream_" so that would be seen in the player, if you change it, they will be changed in the player too

Hardikverma commented 6 days ago

Appreciate your quick response @Joel2B it was ## Generated with https://github.com/google/shaka-packager version v2.4.3-dd9870075f-release Following is the default saka player with the same stream image image it is practically impossible to make such change, moreover it is beyond my control

Joel2B commented 6 days ago

if you generate the sources, you can set the name of each source, if i am not mistaken, using hlsname in your commands to generate the sources, will set a name, if not, will set a default one which would be the “stream”, which is what we see in your m3u8,

to see if its true, edit your m3u8, and change the value of the "NAME" attributes, to one that corresponds, and reload the player again

Hardikverma commented 5 days ago

@Joel2B Actually it's beyond my control to make those changes I guess it won't be be much work So, if you can provide some reference to the code where it is been declared to use those key value so that can i can made some tweak and regenerate. Would really appreciate that. Thank you