react-player
react-player copied to clipboard
playlist 403 Forbidden
am not able to load the m3u8 video files.
<ReactPlayer ref={player} width={'100%'} height={'100%'} url={'http://nimtrans.ilike.ps:8081/hadaraH/headend_1|RotanaMusic_480p/playlist.m3u8'} playing={playing} muted={muted} pip={pip} stopOnUnmount={!pip} onBuffer={onBuffer} onBufferEnd={onBufferEnd} onDisablePIP={closePip} onDuration={setDuration} onProgress={onProgress} volume={volume / 100} onEnded={onEnded} onPlay={playVideo} onPause={stopPlaying} loop={loop} // config={{ // file: { // hlsOptions: { // xhrSetup: function xhrSetup(xhr, url) { // xhr.setRequestHeader( // "Access-Control-Allow-Headers", // "Content-Type, Accept, X-Requested-With" // ); // xhr.setRequestHeader( // "Access-Control-Allow-Origin", // "http://localhost:3001" // ); // xhr.setRequestHeader( // "Access-Control-Allow-Credentials", // "true" // ); // // xhr.open('GET', url + getQueryParams(mediaStreamUrl)); // } // } // } // }} />
if i uncommet the config file getting cors error.
