Hi @wizz ,
I will look into your problem after my exams are over. =(
I’ll reply you as soon as my exams have ended.
Hi @wizz ,
I will look into your problem after my exams are over. =(
I’ll reply you as soon as my exams have ended.
Hi @wizz ,
It was designed to start up with the video loading after “DISPLAY=:0 npm start”. To hide the embedded video away, just press “show-all” from the remote control module
Im finding a work around for your request. However, im a little busy with my school and assignments. I’ll look into it once Im free!
Hi @strawberry-3.141 ,
What’s this “pr in the pipe” that you mentioned? Im interested in learning it.
Sorry im not too familiar with the guidelines. Thanks for amending them !
Im a new user to GitHub as well. Do correct me if there are any errors.
Hi everyone,
This is my first module development so please pardon me if i made any mistakes. This module allows you to play and control youtube video by using Jopyth’s Remote Control Module. This module wont be possible without the help of @Jopyth & @strawberry-3-141
When you press “hide-all” under his Remote control module, the youtube video will appear and start playing.
So the opposite will happen when you press “show-all”, youtube pause and disappears.
P.S : Im relatively new to programming so please bear with me if I couldn’t understand your request.
[card:zichao92/youtube]
OMG you are life saver. So the whole trick to my module is to use sendcommand instead?
Hi @strawberry-3.141 ,
I just uploaded to github ( not too sure if i have done it correctly , first time using github) but here you go.
https://github.com/zichao92/youtube/tree/Remote-
Edit 1: I’m still using an older version of Remote Control module by Jopyth, it’s more stable on my MagicMirror( less laggy etc). Im not too sure why though
Hi @strawberry-3.141 ,
Thanks for the clarification!
I have added id = "my-vdieo"
into my code, however, it produced another error :
Uncaught TypeError: myPlayer.playVideo is not a function
at Class.playthevideo (youtube.js:69)
It’s not able to detect the function. After doing some readings about embedded YouTube videos, i came across this site :
https://developers.google.com/youtube/js_api_reference#onYouTubePlayerReady
It was mentioned that i require a callback function named onYouTubePlayerReady. The API will call this function when the player is fully loaded and the API is ready to receive calls.
From there, I should be able to control my video. However, since this function can only be called in getDom function, im not too sure how it should work from here.
@strawberry-3.141 said in Controlling Embedded Youtube Video on MM:
playthevideo: function() {
//do the stuff
}
Hi there,
I tried your recommendation but i got this error Uncaught TypeError: Cannot read property 'playVideo' of null
.
Which is coming from this code:
playthevideo: function() {
var myPlayer = document.getElementById('my-video');
myPlayer.playVideo();
},
I suspect that the problem is that the above function is not being recognise as my embedded youtube codes still lies in the getDom function, which has the allowscriptaccess="awalys"
that allows the user to control the video. I tried to extract out from the getDom function but i think my syntax is wrong. Here’s the full code of the youtube function that’s in the getDom function.
wrapper.innerHTML='<div> <div> //(youtube link here ) controls=0&showinfo=0&rel=0&autoplay=1" allowscriptaccess="always" name="my-video" frameborder="0" enablejsapi=1&version=3&playerapiid=ytplayer" type="application/x-shockwave-flash"> allowfullscreen></div></div>';