Open vanminhquangtri opened 2 weeks ago
Hi @vanminhquangtri , is there an error thrown when trying to change to an unsupported codec? VHS should be checking the playlists on initialization for unsupported codecs via excludeUnsupportedVariants_
on initialization https://github.com/videojs/http-streaming/blob/8456cb3c1c8af207156c0330a9cc2050592e8880/src/playlist-controller.js#L2062.
If these codecs are not supported by MSE (need to be transmuxed), they may not be supported by mux.js yet or there could be a bug.
Regardless, if you want to manually filter the available player.audioTracks
you can use the player.audioTracks().removeTrack(trackToRemove)
function to remove available audio tracks.
Hello @adrums86 , thanks for your response. Player not throw any error when switch to un-supported audio codec. It just loading. And the video tag is paused.
This is my demo and screen recorder the issue https://codesandbox.io/p/sandbox/videojs-player-3cvkd4?file=%2Findex.html%3A55%2C15
https://github.com/user-attachments/assets/147383b2-c6c7-4b13-a0f0-69cb16f7db9c
First of all, videojs is really nice, thank you for your all effort to offer a perfect player for community. We use videojs for years and have many positive comment from our clients.
At this moment, we are using multi codec for audio, not only AAC, we also use AC3, E-AC3. Some of these codecs is not widely supported by browsers. For example Chrome window not support AC3, E-AC3. But unfortunately, function player player.audioTracks() is still return these audio. Then when user select these codecs, player is paused.
You can check a demo here on Chrome on Window: https://codesandbox.io/p/sandbox/videojs-player-3cvkd4?file=%2Findex.html%3A16%2C83-16%2C105
So my question is, 1/ In videojs, is there any function/config to only get the supported audio codecs when we call player.audioTracks()? 2/ Or how to detect the codec of audio from the list audio of player.audioTracks()? We will ourself check if codecs is support we will show.
Thank you.