I have created a separate javascript file and I'm trying to call the function from html.
'use strict' var intializeVideoJs = (videoUrl) => { alert("inside function"); console.log("this is the videoUrl"); console.log(videoUrl); videojs('video', { controls: true, muted: false, techOrder: ["youtube"], width: 500, sources: [{ "type": "video/youtube", "src": 'https://www.youtube.com/watch?v=iD_MyDbP_ZE' }], plugins: { videoJsResolutionSwitcher: { default: 'low', dynamicLabel: true } } }, function() { var player = this; window.player = player; player.on('resolutionchange', function() { console.info('Source changed') }) }); }
I get the following errors
VIDEOJS: ERROR: Unable to find plugin: videoJsResolutionSwitcher
video.js:16869 VIDEOJS: ERROR: The "Youtube" tech is undefined. Skipped browser support check for that tech.
VIDEOJS: ERROR: (CODE:4 MEDIA_ERR_SRC_NOT_SUPPORTED) No compatible source was found for this video. MediaErrorcode: 4message: "No compatible source was found for this video."proto: Object
_logType @ video.js:16869
This works fine when I initialize it directly in the script tag.
I also get the same error when I try to run it inside jquery's document.ready function.
I am retrieving my URL from the backend. So, I want the initializations to take place after I have the URL.
I have created a separate javascript file and I'm trying to call the function from html.
'use strict' var intializeVideoJs = (videoUrl) => { alert("inside function"); console.log("this is the videoUrl"); console.log(videoUrl); videojs('video', { controls: true, muted: false, techOrder: ["youtube"], width: 500, sources: [{ "type": "video/youtube", "src": 'https://www.youtube.com/watch?v=iD_MyDbP_ZE' }], plugins: { videoJsResolutionSwitcher: { default: 'low', dynamicLabel: true } } }, function() { var player = this; window.player = player; player.on('resolutionchange', function() { console.info('Source changed') }) }); }
I get the following errors
This works fine when I initialize it directly in the script tag. I also get the same error when I try to run it inside jquery's document.ready function.
I am retrieving my URL from the backend. So, I want the initializations to take place after I have the URL.