Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to filter only audio that its codec is supported #8885

Open
vanminhquangtri opened this issue Oct 7, 2024 · 2 comments
Open

How to filter only audio that its codec is supported #8885

vanminhquangtri opened this issue Oct 7, 2024 · 2 comments
Labels

Comments

@vanminhquangtri
Copy link

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.

@adrums86
Copy link
Contributor

adrums86 commented Oct 23, 2024

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.

@vanminhquangtri
Copy link
Author

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

bandicam.2024-10-23.10-06-45-284.mp4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants