Hey all,
Im working on a website that has to be capable of viewing youtube video's without having to browse to youtube itself. I followed the tutorials from both video.js and video.js' youtube plugin, but when the page loads, it gives me: Uncaught ReferenceError: videojs is not defined (vjs.youtube.js line 25)
The code is as follows:
<!-- video.js-->
<link href="http://vjs.zencdn.net/4.6/video-js.css" rel="stylesheet">
<script src="https://vjs.zencdn.net/4.6/video.js"></script>
<!-- youtube addon. -->
<script src="vendor/videojs/video.js/dist/video-js/vjs.youtube.js"></script>
<!-- bunch of HTML code, *snip* -->
<div id="videoContainer" class="ImageViewerContent tab-pane fade in">
<video id='videoPlayer' class="video-js vjs-default-skin vjs-big-play-centered"
data-setup='{ "techOrder": ["youtube"],
"src": "https://www.youtube.com/watch?v=6pnr7P0qERA",
"preload":"auto",
"controls":true,
"poster":"https://i.ytimg.com/vi/6pnr7P0qERA/hqdefault.jpg",
"width":450,
"height":254
}'>
<p class="vjs-no-js"><?php echo PRODUCT_VIDEO_NOT_SUPPORTED; ?></p>
</video>
</div>
The poster does show up, and when i click it, i get "Uncaught TypeError: Cannot read property 'play' of undefined " (video.js line 58)
I tried this using 4.5.1 of video.js, 4.6 and 4.10