micnews / react-jw-player

A React Component API for JW Player

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

onXhrOpen setup to remove the 'range' header before sending the request?

kylane opened this issue · comments

commented

Ahoy!

Thanks for this component - has been awesome.

Having trouble trying to modify the request headers, as we're having some cloudfront issues with the 'range' header - how would I go about removing the range from the request headers?

Cheers!

commented

Would this do the trick?

<ReactJWPlayer
    playerId="previewVideo"
    playerScript="https://cdn.jwplayer.com/libraries/XXX.js"
    onVideoLoad={this.videoLoaded}
    onSetupError={this.videoFailed}
    onMediaError={this.videoFailed}
    isAutoPlay
    playlist={
        [{
            sources: [
                    {
                        file: previewMediaUrl,
                        onXhrOpen: (xhr) => {
                            xhr.setRequestHeader('range', '');
                        },
                    },
                ],
            }]
        }
/>