<script type='text/javascript' src='../../Tools/mediaplayer-5.7-viral/jwplayer.js'></script>
<div id='mediaspace'>
</div>
<script type='text/javascript'>
    jwplayer('mediaspace').setup({
        'flashplayer': 'http://player.longtailvideo.com/player.swf',
        'file': 'http://content4.longtailvideo.com/videos/flvplayer.flv',
        'controlbar': 'bottom',
        'width': '470',
        'height': '320'
    });
</script>
<input type="button" value="开始" onclick="document.getElementById('mediaspace').sendEvent('PLAY', 'true')" />
<input type="button" value="暂停" onclick="document.getElementById('mediaspace').sendEvent('PLAY', 'false')" />
<input type="button" value="停止" onclick="document.getElementById('mediaspace').sendEvent('STOP')" />如上面,我已经可以用JS控制播放了
那现在我要添加三个按钮<input type="button" value="取得状态" onclick="?" />
<input type="button" value="当前播放秒数" onclick="?" />
<input type="button" value="转到第30秒播放" onclick="?" />取得状态为:播放中,暂停中,已停止
取得播放秒数为得到当前播到第几秒
转到第30秒播放:就是转到指定秒数播放谢谢

解决方案 »

  1.   

    考虑到篇幅,我发了一篇解决方法到我的博客里,有不足之处请指正。
    http://blog.csdn.net/tomysea/article/details/6685553其实官方有详细的说明,API非常丰富,希望可以帮到你。
      

  2.   

    MediaPlayer播放: MediaPlayer.Play()
    暂停: MediaPlayer.Pause()
    定位: MediaPlayer.SetCurrentEntry(lWhichEntry)
    MediaPlayer.Next()
    MediaPlayer.Previous()
    循环: MediaPlayer.PlayCount = 0
    0:the clip plays repeatedly
    1:once
    停止: MediaPlayer.Stop()
      

  3.   

    javascript和flash是可以交互的,但必须你的player.swf里面提供了 调用的方法。一般情况下,这个控制都是在player.swf播放器里面控制的,不是采用js控制的。