Ordep-20
Active Coder
Hi guys I'm stucked in this nodeJS problem, I trying to make an embed youtube server using NodeJS, the base Idea its use and youtube/cdns video with external audio sync, I 've done this in PHP but have some issues for sync.
I used this example https://github.com/markcellus/youtube-video-js/blob/master/examples/youtube-video.html, but is giving this error module from “http://localhost:3000/youtube-video-js/dist/youtube-video.js” was blocked because of a disallowed MIME type.
I'm on windows 8, last version of node, i not have bigger experience in NodejS
Thanks
I used this example https://github.com/markcellus/youtube-video-js/blob/master/examples/youtube-video.html, but is giving this error module from “http://localhost:3000/youtube-video-js/dist/youtube-video.js” was blocked because of a disallowed MIME type.
Code:
npm i youtube-video-js
<!-- index.html -->
<script
type="module"
src="/node_modules/youtube-video-js/dist/youtube-video.js"
></script>
<youtube-video
width="640"
height="360"
src="https://www.youtube.com/watch?v=Wn9twYUXw6w"
autoplay
controls
/>
<script>
const videoElement = document.querySelector('youtube-video');
// must wait for DOM to be ready and for component to be accessible
document.addEventListener('DOMContentLoaded', function () {
// wait for loading
videoElement.load().then(() => {
// pause video after two seconds
const timer = setTimeout(function () {
videoElement.pause();
clearTimeout(timer);
}, 2000);
});
});
</script>
I'm on windows 8, last version of node, i not have bigger experience in NodejS
Thanks