-
Notifications
You must be signed in to change notification settings - Fork 56
Video player fails to play signed urls #320
Comments
Hi @pedramp20, please can you provide the VideoPlayer component source code ? |
@nathanagez I actually realised that for signed urls the right way of passing source and token is as follows:
However, now I am getting the following error:
Here is the videoplayer component code:
Ps. Since video setup got stuck in adding video js to package.json, I manually added the package and called setup again. |
@pedramp20 token have to be append to each requests, I'll provide you the correct snippet of code but I'm not in front of my computer FTM. |
@nathanagez do you mean this? https://gist.github.com/wizage/1523dd1f6928e0d852042e6adbaf54cd |
I resolved the issue using React Player. if anyone else is having problem with playing HLS with credentials. here is how to play it with react player:
|
Yes but instead of using import React from 'react';
import videojs from 'video.js';
import 'video.js/dist/video-js.css';
export default class VideoPlayer extends React.Component {
componentDidMount() {
videojs.Vhs.xhr.beforeRequest = (function (options) {
options.uri = `${options.uri}${this.props.token}`;
return options;
}).bind(this);
this.player = videojs(this.videoNode, this.props);
}
componentWillUnmount() {
if (this.player) {
this.player.dispose();
}
}
render() {
return (
<div>
<div data-vjs-player>
<video ref={(node) => { this.videoNode = node; }} className="video-js"></video>
</div>
</div>
);
}
} |
@nathanagez I am having problem playing videos using both react player and video js on iOS (Safari). Is there a specific config that needs to be set? I have already tried this but didn't work
|
Describe the bug
When signed url is passed to the suggested video player (video.js), it fails with:
No compatible source was found for this media.
The text was updated successfully, but these errors were encountered: