How to change subtitles of video during Airplay on web

98 Views Asked by At

I have a native video player (VideoElement) with custom controls that supports AirPlay.

The videoElement has textTracks (subtitles) that work fine when playing in the video and they work fine in AirPlay when changing subtitles using the Apple TV Remote.

However, when I start AirPlay I want to be able to change the subtitles (turn them off / on / change language) from my video player controls (without using the Remote).

But this doesn't seem to work? When I try to change the textTracks the update does not reflect on the video during AirPlay.

E.g. This sets the textTrack.mode correctly and I can console log it correctly afterwards, but it does not update the current AirPlay session to reflect the change.

const textTrack = videoElement.textTracks[0]
textTrack.mode = 'hidden' // this should hide the subtitles

(in the above simplified example I only have 1 textTrack for testing "English" that's either on or off)

Is it not possible to change subtitles from web during an AirPlay session?

0

There are 0 best solutions below