Results 1 to 2 of 2

Thread: Question Regarding Embed Youtube

  1. #1
    Join Date
    Jan 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Question Regarding Embed Youtube

    Okay, here is the question.

    I am using Web Easy 8 Professional (Since I am a dud when it comes to websites), In otherwards, I have just began trying to learn scripting. What I am trying to do is make an embed YouTube for my website, where I can click a button or hyperlink and it will use the same object but change the video.

    Right now all I have to do in the Custom Script to get the first video to work is by putting

    Code Snippet

    <iframe title="YouTube video player" class="youtube-player" type="text/html" width="1280" height="750" src="http://www.youtube.com/embed/9uCsZDace6o?rel=0&amp;hd=1;autoplay=1" frameborder="0" allowFullScreen></iframe>

    I can't seem to get it to work with the document viewer script.

    Code Snippet from D.Viewer

    <form name="jumpy">
    <select name="example" size="1" onChange="gone()">

    <option value="http://www.yahoo.com" selected>Yahoo.com</option>
    <option value="http://www.google.com">Google</option>
    <option value="http://www.lycos.com">Lycos</option>
    <option value="http://www.AltaVista.com">AltaVista</option>
    </select>

    <input type="button" name="test" value="Go!" onClick="gone()">
    </form>

    <script language="javascript">


    //Specify display mode (0 or 1)
    //0 causes document to be displayed in an inline frame, while 1 in a new browser window
    var displaymode=0
    //if displaymode=0, configure inline frame attributes (ie: dimensions, intial document shown
    var iframecode='<iframe id="external" style="width:95%;height:400px" src="http://www.yahoo.com"></iframe>'

    /////NO NEED TO EDIT BELOW HERE////////////

    if (displaymode==0)
    document.write(iframecode)

    function gone(){
    var selectedurl=document.jumpy.example.options[document.jumpy.example.selectedIndex].value
    if (document.getElementById&&displaymode==0)
    document.getElementById("external").src=selectedurl
    else if (document.all&&displaymode==0)
    document.all.external.src=selectedurl
    else{
    if (!window.win2||win2.closed)
    win2=window.open(selectedurl)
    //else if win2 already exists
    else{
    win2.location=selectedurl
    win2.focus()
    }
    }
    }
    //-->
    </script>

    Any help is welcomed

  2. #2
    Join Date
    Sep 2007
    Location
    The Netherlands
    Posts
    1,371
    Thanks
    31
    Thanked 141 Times in 136 Posts
    Blog Entries
    32

    Default

    See this.
    If you want this to work when the link is a selectbox option, I can figure something out for you.
    ===
    Arie Molendijk.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •