0

使用jQuery tubeplayer,如何设置一个按钮来停止任何视频嵌入?

我尝试使用 php 渲染多个视频:

echo '
<div class="video_frame">
<script type="text/javascript">
$(".video_frame").tubeplayer({
width: 960, // the width of the player
height: 390, // the height of the player
allowFullScreen: "true", // true by default, allow user to go full screen
initialVideo: "'.$destaque_g['video'].'", // the video that is loaded into the player
preferredQuality: "default",// preferred quality: default, small, medium, large, hd720
onPlay: function(id){}, // after the play method is called
onPause: function(){}, // after the pause method is called
onStop: function(){}, // after the player is stopped
onSeek: function(time){}, // after the video has been seeked to a defined point
onMute: function(){}, // after the player is muted
onUnMute: function(){} // after the player is unmuted
});
</script>
<div>';

并在 head 文档标签中调用它:

$('.stripe_bottom').find('a').click(function() {
$('.video_frame').tubeplayer('stop');
});

我希望任何带有“stripe_bottom”类的div内的标签“a”都可以停止任何带有“video_frame”类的div内的视频。

当我单击“stripe_bottom”内的链接时,第一个视频会停止,但另一个视频不会停止。

任何人都可以帮忙吗?

4

1 回答 1

0

尝试这个:

$('.stripe_bottom').find('a').click(function() {
    $('.video_frame').each(function(){$(this).tubeplayer('stop');});
});
于 2012-10-30T15:25:59.773 回答