www.webdeveloper.com
Results 1 to 2 of 2

Thread: jQuery accessing video player

  1. #1
    Join Date
    Feb 2014
    Posts
    6

    jQuery accessing video player

    Hi, so far I can retrieve the info I want about the video I need to load but can't seem go get the video to change. I would really like to know what concepts I am weak on in jQuery so I can try to brush-up and get better at making pages do what I want. What am I not understanding here or missing. I am also considering that it may be something about the way that objects (e.g. DOM objects) like video perform in a page. I have replaced the video with some test content because my original video and content and video was very large. Thanks
    http://pctechtv.com/fm/test-4-help.zip

  2. #2
    Join Date
    Feb 2014
    Location
    Managua, Nicaragua
    Posts
    38
    Add this code between your <head> tag... i test it with ur example, and work fine...

    Code:
    <script>
    jQuery(document).ready(function($){
    	$('#list_area ul li a').click(function(e){
    	
    		var id = jQuery(this).attr('num');
    		var poster = jQuery('#' + id).children('img').attr('src');
    		var sourcevideo = jQuery('#' + id).children('video').html();
    		var description = jQuery('#' + id).children('p').html();
    		
    		jQuery('.video_area').html('<video id="example_video_1" class="video-js vjs-default-skin" controls preload="none" width="640" height="360" poster="' + poster + '" data-setup="{}">' + sourcevideo + '</video><p id="vid_description">' + description + '</p>');
    		
    		e.preventDefault();
    	});
    })
    </script>
    hope to be helpful

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