Alternative video
Hi, do you have any plans to add options for alternative video ? It will be very useful, for example during live streaming from sports events. It canbe use to switch to another camera. I found some info at wowza site https://www.wowza.com/docs/how-to-use-alternative-audio-or-video-tracks-with-apple-hls-streams. Please check alternative-video.smil paragraph.
Hi @popler we don't have a plan as of today, but contributions are always welcome ;-)
Here is a link to that section in Apples RFC: https://tools.ietf.org/html/rfc8216#section-4.3.4.1.1
I'd also be interested in that feature. It seems to me, that it shouldn't be too hard to implement, if you already know how to switch between different bitrates and already support alternate audio renditions.
I would also be interested ... Any plan to do it? Other hls libraries have done it (videojs-hls-contrib)
no plan, anybody feel free to contribute
hey, i have added this feature last year in our fork of videojs-contrib-hls. it would be great to have it in Hls.js as well to use this library for those types of applications. @tmoehle @Llorito @popler feel free to contact me about this.
@tchakabam can't you create a PR on hls.js ?
I have modified current code a bit, and I am able to get the video tracks:
...
// Ripoff of audio tracks parsing
var videoGroups = levels.map(function (level) {
return {
id: level.attrs.VIDEO,
codec: level.audioCodec
};
});
var videoTracks = m3u8_parser.parseMasterPlaylistMedia(string, url, 'VIDEO', videoGroups);
if (videoTracks.length) {
var embeddedVideoFound = false;
videoTracks.forEach(function (audioTrack) {
if (!audioTrack.url) {
embeddedVideoFound = true;
}
});
if (embeddedVideoFound === false && levels[0].videoCodec && !levels[0].attrs.VIDEO) {
logger["b" /* logger */].log('video codec signaled in quality level, but no embedded video track signaled, create one');
videoTracks.unshift({
type: 'main',
name: 'main'
});
}
}
hls.trigger(events["a" /* default */].MANIFEST_LOADED, {
levels: levels,
audioTracks: audioTracks,
videoTracks: videoTracks,
subtitles: subtitles,
url: url,
stats: stats,
networkDetails: networkDetails
});
};
...
Now they are exposed to MANIFEST_LOADED, problem now is, what API should one use to be able to switch to another video track ?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.