Diptendu
Diptendu

Reputation: 13

videojs is not sending headers from beforerequests in IOS

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

Answers (1)

misterben
misterben

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

Related Questions