player icon indicating copy to clipboard operation
player copied to clipboard

Audio Tracks Support

Open mihar-22 opened this issue 4 years ago • 1 comments

Tasks

Design and implement an interface to support retreiving and setting audio tracks across providers.

Notes

Properties

  • audioTracks: AudioTrack[]
  • currentAudioTrack: number
  • canSetAudioTrack: boolean

Methods

  • setCurrentAudioTrack(trackId: number): Promise<void>

Events

  • vds-audio-tracks-change
  • vds-current-audio-track-change
  • vds-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 canSetAudioTrack property. Refer to the canRequestFullscreen property on the MediaContext for 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

mihar-22 avatar Feb 02 '21 02:02 mihar-22

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

ghost avatar Mar 15 '22 20:03 ghost