THEOplayer / samples-html5-sdk

📚 Universal Video Player code samples for web
https://codesandbox.io/s/github/THEOplayer/samples-web
26 stars 12 forks source link

how to enable withcredentials for sending local cookies to server? #46

Open hasnainshafqatmlt opened 2 years ago

hasnainshafqatmlt commented 2 years ago

Hi Team

I'm looking for a small help about enabling the cookies thing in video. As like other 3rd party plugins for sending request to server e-g Axios we do withCredentials: true and it automatically send local browser cookies to server.

I'm curious how I can enable that functionality in theoplayer configuration so that when it sends request to server then local cookies should be sent in headers automatically.

my code example is function videoOptions (videoUrl: string, videoType?: string) => { return { source: { sources: [ { type: videoType || 'application/x-mpegurl', src: videoUrl } ] } } }

const player = window.THEOplayer && new window.THEOplayer.Player(this.$refs.theoplayer, { fluid: true, libraryLocation: '//cdn.theoplayer.com/dash/theoplayer/', license: 'abc', allowNativeFullscreen: true, mutedAutoplay: true, useCredentials: true }) player.source = this.options && this.options.source;

<TheoPlayer :options="videoOptions('www.abc_file.mp4')" :full-screen='true' :autoplay='true' />