2010-12-03 3 views
0

jQuery 사이클 슬라이더에 JW HTML5 플레이어를 통합했습니다. 문제는 페이지가로드 될 때 재생되는 자동 재생 비디오를 설정하고 해당 슬라이드가 표시 될 때가 아니라 플래시 비디오가 어떻게되는지입니다. 슬라이드가 표시 될 때까지 HTML5 동영상이 재생되지 않도록 할 수있는 방법이 있습니까?슬라이더의 HTML5 비디오 자동 재생 문제

http://dev.opera.com/articles/view/introduction-html5-video/

당신은 비디오를 시작합니다 JS으로 재생() 함수를 묶을 수 :

<video id="video-'.$video_name.'" width="'.$width.'" height="'.$height.'" poster="'.get_bloginfo('template_directory') .'/lib/scripts/timthumb.php?src='.$image.'&h='.$height.'&w='.$width.'&zc=1" controls="controls"> 

       <source src="'.$html5_1.'" type="video/mp4" /> 
       <source src="'.$html5_1.'" type="video/webm" /> 
       <source src="'.$html5_2.'" type="video/ogg" /> 

      </video> 

      <script> 
       jwplayer("video-'.$video_name.'").setup({ 
        file: "'.$url.'", 
        image: "'.get_bloginfo('template_directory') .'/lib/scripts/timthumb.php?src='.$image.'&h='.$height.'&w='.$width.'&zc=1", 
        icons: "'.$icons.'", 
        autostart: "'.$autostart.'", 
        stretching: "'.$stretching.'", 
        controlbar: "'.$controlbar.'", 
        skin: "'.$skin.'", 
        screencolor: "white", 
        height: '.$height.', 
        width: '.$width.', 
        players: [';      
        if($fallback == "flash") { 
         $out .= '{type: "html5"}, {type: "flash", src: "'.get_bloginfo("template_directory").'/lib/scripts/mediaplayer/player.swf"}'; 
        } elseif($fallback == "html5") { 
         $out .= '{type: "flash", src: "'.get_bloginfo("template_directory").'/lib/scripts/mediaplayer/player.swf"}, { type: "html5" },'; 
        } 
        $out .= '] 
       }); 
      </script>'; 

답변

0

이 오페라 dev에 문서를 참조하십시오

내가 사용하고 코드입니다 그 슬라이드가로드 될 때.

+0

Thannks Grillz로 설정할 수 있습니다. 문제는 그 기능을 슬라이더에 묶는 방법을 잘 모르겠습니다. – GhostPool

+0

나는 당신의 js를 볼 필요가 있지만, 다음과 같은 식으로 다음/prev 버튼에 로직을 묶을 것이다 : 만약 slideshow div ID == 비디오 div id이면 play() –

0

세트 video 태그 Attributepreload="auto"

프리로드 속성을 지정하는 경우 어떻게 저자가 생각하는 비디오가 페이지가로드 될 때로드해야합니다. preload의 기본값은 none이고 metadata 또는 auto