video.js
video.js copied to clipboard
preload doesn't work with hls ?
I instantiate videojs like that
let playerOptions = {
"preload": 'none',
"sources": [{
"type": 'application/x-mpegURL',
"src": 'https://***.eu-west-3.amazonaws.com/' + '/stream.m3u8'
}],
};
var player = videojs(video_reference.current, playerOptions, () => {
player.load() // <-- regardless of where I put this call it doesn't work, if i remove it it works but I loose the control of when to video data
console.log('player ready')
});
whenever i call player.load(). the player displays: "the media could not be loaded", and the blob request fails: "GET blob:http://localhost:3000/e38ba18c-15d9-4ae0-8fdd-31784de6eef7 net::ERR_FILE_NOT_FOUND"
I'm using using "video.js": "^7.10.2", on chrome on macos
👋 Thanks for opening your first issue here! 👋
If you're reporting a 🐞 bug, please make sure you include steps to reproduce it. We get a lot of issues on this repo, so please be patient and we will get back to you as soon as we can. To help make it easier for us to investigate your issue, please follow the contributing guidelines.
This is basically a known issue. I would recommend against calling load()
when non-native playback is being used.
We probably should handle this case properly, though.
Calling load()
won't actually do anything right now for our playback. We actually still end up preloading a bit even when it's set to none. When we fix that issue, I'll make sure we properly support calling load as well.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Any updated guidance here? Bug still exists on Chrome in 8.3.0 and no guidance is offered in https://docs.videojs.com/player#load. I'm trying to explicitly start loading the video data:
/** @param {CallableFunction} beforeLoad */
loadPlayerData( beforeLoad ) {
let player = this.player;
if( player && player.preload() === 'none' && player.paused() && player.readyState() < 1 ) {
if( typeof beforeLoad === 'function' ) beforeLoad();
player.preload('auto');
player.load();
return true;
}
}