plyr icon indicating copy to clipboard operation
plyr copied to clipboard

Pass headers to the HTTP reuqest

Open gp187 opened this issue 6 years ago • 14 comments

It would be a great feature to add basic authentication to the video source.

Passing the credentials directly in the link has been dropped by Chrome and more will follow so http://userb:[email protected]/elon_musk_riding_horse_backwards.mp4 won't pass the credentials any more.

const options = {
   headers: {
     'Authorization': 'Bearer iaf87h8fhd8idfidf=='
   },
   tooltips: {
    controls: true,
    seek: true
  },
 controls: ['play-large', 'play', 'progress', 'current-time', 'mute', 'volume', 'captions', 'settings', 'fullscreen']
};
this.videoPlayer = new Plyr(this.videoPlayerEl.nativeElement, options);

Passing a header to the HTTP request can open all sorts of posibilities for private video streaming

gp187 avatar Jan 11 '19 08:01 gp187