i want the player to play a video with a video id specified by a user (an if specified be me would work) by an input code im not that great at coding, but this code
$('.col-sm-12').append('<div data-video="' + ytmusic + '" data-autoplay="0" data-loop="1" id="youtube-audio"> </div> <script src="https://www.youtube.com/iframe_api"></script> <script src="https://cdn.rawgit.com/labnol/files/master/yt.js"></script><input maxlength="40" type="text" placeholder="Music Video" id="ytmusic" name="ytmusic" class="form-control" style="color: rgb(255, 255, 255);">');
is working great (notice the ytmusic
in the beginning)
I tried to make the variable set using many methods:
var ytmusic = document.getElementsByName("ytmusic").value;
var ytmusic = $('#ytmusic');
Let's say the ytmusic is rgW_I8saK1o , it will play the video https://www.youtube.com/watch?v=rgW_I8saK1o
this link shows the current shape of the code