www.webdeveloper.com
Results 1 to 3 of 3

Thread: Can't get background video to play

  1. #1
    Join Date
    Apr 2008
    Posts
    136

    Can't get background video to play

    I have a program that is to do two things: 1. Play a background video for a predefined number of seconds upon loading. 2. When one of the two links is clicked, it will play the video starting at a predefined point in the video for a predefined number of seconds.

    Before I included the following piece of code:

    Code:
    function show_links	{
    					$('.theLinks').show();
    				}
    The background video did load and played for the 4 seconds I had predefined. But, since adding that piece of code, the video never loads and when clicking on either of the two links, nothing happens.

    Full code:
    Code:
    <!DOCTYPE html>
    <html>
    <head>
      <title>Bigvideo.js Demo</title>
    
      <link rel="stylesheet" href="http://goken68.brinkster.net/Videos/bigvideo.css">
    
       <!-- BigVideo Dependencies -->
        <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    	<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
      	<script src="http://goken68.brinkster.net/Videos/video.js"></script> 
    	<script src="http://goken68.brinkster.net/Videos/bigvideo.js"></script>
    
        <script>
            $(function () {
    			$('.theLinks').hide();
                var BV = new $.BigVideo({ useFlashForFirefox: false });
                BV.init();
                BV.show('http://goken68.brinkster.net/Videos/mov_bbb.mp4', { altSource: 'http://goken68.brinkster.net/Videos/mov_bbb.webm', ambient: true });
    			BV.getPlayer().addEvent(show_links);
    
    		//pause video after 4 seconds
    	    pause = setTimeout(function() { BV.getPlayer().pause(); }, 4000);
    
    		//display the html links
    				function show_links	{
    					$('.theLinks').show();
    				}
    	
    	    
    
            
        function link1()					{
    	
    		BV.getPlayer().currentTime(4);
    		BV.getPlayer().play();
    		//pause video after an additional 3 seconds from the 4 second mark of video
    		BV.getPlayer().pause(3000);
    	}
    
    	function link2()					{
    
    		BV.getPlayer().currentTime(7)
    		BV.getPlayer().play();
    		//pause video after an additional 3 seconds from the 7 second mark of video
    		BV.getPlayer().pause(3000);
    	}
    
    });
    
    </script>
    
    
    </head>
    <body>
    
    <div id="theLinks">
        <a href="#" id="link1" onclick="link1()">Link 1</a> 
        <a href="#" id="link2" onclick="link2()">Link 2</a>
    </div> 
    
      
    
    </body>
    </html>

  2. #2
    Join Date
    Apr 2008
    Posts
    136

  3. #3
    Join Date
    Mar 2007
    Location
    localhost
    Posts
    2,500
    Try asking in the JQuery / JavaScript Frameworks forum
    Yes, I know I'm about as subtle as being hit by a bus..(\\.\ Aug08)
    Yep... I say it like I see it, even if it is like a baseball bat in the nutz... (\\.\ Aug08)
    I want to leave this world the same way I came into it, Screaming, Incontinent & No memory!
    I laughed that hard I burst my colostomy bag... (\\.\ May03)
    Life for some is like a car accident... Mine is like a motorway pile up...

    Problems with Vista? :: Getting Cryptic wid it. :: The 'C' word! :: Whois?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles