eluv-io / elv-stream-sample

MIT License
4 stars 2 forks source link

Simple Mux integration #2

Closed elv-peter closed 5 years ago

elv-peter commented 5 years ago

Had to downgrade dashjs version for Mux.

Note that in order to add a feature to play videos continuously in the same video element, we'll need to notify mux:

// Example of changing the source of a video element
// Should happen before emitting the videochange event
var myVideo = document.querySelector('#myVideo');
myVideo.src = 'nextVideo.mp4';

if (typeof mux !== 'undefined') {
  mux.emit('#myVideo', 'videochange', {
    video_id: 'abc345',
    video_title: 'My Other Great Video',
    video_series: 'Weekly Great Videos',
    ...
  });
}

I only hooked up video ID and name, but there are more metadata supported by Mux: https://docs.mux.com/docs/metadata

Also, they mentioned tracking users with cookies: https://docs.mux.com/docs/web-integration-guide