user1966143
user1966143

Reputation: 23

Use same mediaSource in two videoElement

I would like to know If it is possible to use the same mediaSource in two videoElement instances.

My goal is use a m3u8's HLS file with several cameras and two video instances syncronized with different cameras.

Upvotes: 0

Views: 460

Answers (1)

Brad
Brad

Reputation: 163448

Yes, that's possible but you'll find that there (currently) is no way to do multi-track video. Therefore, the same MediaSource can only host the one video for playback.

In the near future, this should be more possible, as browser APIs start to support multiple video tracks.

There is also the MediaGroup standard for synchronizing the playback of multiple video players with independent sources, but this API is effectively dead and not well supported.

You will have to do this with your code, by watching timestamps closely and synchronizing state between players as best as you can. This isn't ideal, but is probably your best option.

Upvotes: 0

Related Questions