Reputation: 13
Have created a learning app for colleagues ... videojs works perfectly for android users i am able to send headers and cookies but for IOS people it does not send headers ... I am verifying users based on headers send from videojs also calculating time they stayed in app using videojs headers.... code sample given below:
function videopresent(){
videojs.options.hls.overrideNative = true;
videojs.options.html5.nativeAudioTracks = false;
videojs.options.html5.nativeTextTracks = false;
videojs.Hls.xhr.beforeRequest = function(options) {
headers = {}
headers['user_Id'] = cookiescope('user_Id');
headers['user_Policy_code'] = cookiescope('user_Policy_code');
headers['username'] = cookiescope('username');
options.headers = headers
return options;
}
}
NOTE : It works on android phones and all the browsers(chrome,mozilla,safari) on desktop versions.
Upvotes: 1
Views: 1351
Reputation: 7821
overrideNative
only works if the browser supports Media Source Extensions, which iOS Safari does not. Manipulating each request is not possible with iOS Safari's native playback.
Upvotes: 3