player
player copied to clipboard
Audio Tracks Support
Tasks
Design and implement an interface to support retreiving and setting audio tracks across providers.
Notes
Properties
audioTracks: AudioTrack[]currentAudioTrack: numbercanSetAudioTrack: boolean
Methods
setCurrentAudioTrack(trackId: number): Promise<void>
Events
vds-audio-tracks-changevds-current-audio-track-changevds-audio-track-change-request
Important
- There's no native interface for an
AudioTrack, how can this be designed across providers? - How to know if the current provider supports setting audio tracks? The interface designed should account for this via the
canSetAudioTrackproperty. Refer to thecanRequestFullscreenproperty on theMediaContextfor a similar implementation.
References
- https://github.com/vime-js/vime/blob/master/core/src/components/core/player/PlayerProps.ts#L453-L463
- https://github.com/vime-js/vime/blob/master/core/src/components/core/player/PlayerMethods.ts#L129-L137
- https://github.com/vime-js/vime/blob/master/core/src/components/core/player/player.tsx#L658-L668
- https://github.com/vime-js/vime/blob/master/core/src/components/providers/hls/hls.tsx#L255-L259
I think allowing adding audio tracks from aac or m4a files would be great. If there are, say, 5 audio tracks for a video file and only one is being played at a time, the other 4 tracks would be wasting bandwidth. If the audio tracks are separate then only one would be streamed at a time.
Edit: After experimenting a bit with this myself I don't think this idea is worth it, on desktop it's fine but there are sync problems especially on iOS safari