Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    hyperlink to video player and start video

    On my website I have a video player at the top and below that a list of videos. Users click on one of the videos and that video begins playing in the player at the top of the page. Is there any way that the link the user clicks to play the video can also jump to the video player at the top of the page? I've tried various hyperlinks but I can't get it to work. The videos play fine, but the users don't realize that they need to scroll back up to the top of the page to see the video.

    http://manoamano.org/videos/videos.html

    #### below is the video player ####

    Code:
    <div id='videoPlayback' style='width: 425px; height:344px;'>
    <!-- <div style='width: 425px; margin-left: auto; margin-right: auto; margin-top: 10px;'> -->
    <img src="images/mano-logo-videosNEW425x344.jpg" width="425" height="344">
    ### The javascript below plays the video ###

    Code:
    <script type="text/javascript">
    function playVideo(sourceId, targetId) {
    if (typeof(sourceId)=='string') {sourceId=document.getElementById(sourceId);}
    if (typeof(targetId)=='string') {targetId=document.getElementById(targetId);}
    targetId.innerHTML=sourceId.innerHTML;
    return false;
    }
    </script>
    #### below is the information/variables for a specific video #####
    Code:
    <div id='PampasdeLeque' style='display: none'>
    <object width="425" height="344">
    <param name="movie" value="http://www.youtube.com/v/4xCUO3qcPWA&hl "></param>
    <param name="wmode" value="transparent"></param>
    <embed src="http://www.youtube.com/v/4xCUO3qcPWA&hl&autoplay=1" 
    type="application/x-shockwave-flash" wmode="transparent" 
    width="425" height="344">
    </embed></object>
    </div>
    #### below is the link that starts a specific video playing in the player above #####

    Code:
    <A HREF="#" onclick='return playVideo("PampasdeLeque","videoPlayback")'>
    <img border="0" src="images/pampasdeleque.jpg" width="120" height="90">
    </A>

  • #2
    Regular Coder
    Join Date
    Feb 2009
    Location
    Wheeling, IL
    Posts
    358
    Thanks
    5
    Thanked 62 Times in 60 Posts
    Easily solvable by making the browser follow the link rather than ignore it:

    Code:
    <script type="text/javascript">
    function playVideo(sourceId, targetId) {
    if (typeof(sourceId)=='string') {sourceId=document.getElementById(sourceId);}
    if (typeof(targetId)=='string') {targetId=document.getElementById(targetId);}
    targetId.innerHTML=sourceId.innerHTML;
    return true;
    }
    </script>
    Try that, see how it goes for you.
    The way to success is to assume that there are no impossible things. After all, if you think something is impossible, you will not even try to do it.

    How to ask smart questions?

  • #3
    New to the CF scene
    Join Date
    Apr 2009
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    that works!

    Excellent, elegant, simple solution. Thank You!!!! Wow, I really appreciate your knowledge and your help, you saved me hours of time and hassle and probably saved me from breaking something while trying to fix it. This solution lets me fix it without any chance of breaking anything else on the page.
    Thanks again!


  •  

    Tags for this Thread

    Posting Permissions

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