flowplayer播放列表跟踪自动更改给出错误

时间:2016-08-11 08:32:22

标签: angularjs flowplayer

我正在使用Flowplayer(在Mean js音频流项目中)使用Wowza流引擎软件和使用角度js的以下服务进行RTMP音频流。

 app.service('flowPlayerService', ['$cookies','constant',function ($cookies,constant) {
    player: null,
    currentTitle:'',
    constructPlaylist: function (playlist) {


        var currentObj = this;
        this.player = flowplayer("flashPlayer", "lib/flowplayer/flowplayer-3.2.18.swf", {         
            playlist:playlist,
            onBegin: function(talk){
                console.log('clip changed');

            },
            onFail:function(){
                //alert('loading failed');
            },
            onFinish:function(){
                console.log('finisheds');

            },
            //  engine:'html5',
            // Specify the location of the RTMP plugin.
            plugins: {
                rtmp: {
                    url: 'lib/flowplayer/flowplayer.rtmp-3.2.13.swf',
                    netConnectionUrl: 'rtmp://10.10.3.11/vod'
                },
                controls: {
                    autoHide: 'never',
                    url: 'lib/flowplayer/flowplayer.controls-3.2.16.swf',
                    tooltips: {
                        buttons: true,
                        fullscreen: false,
                        pause: 'Continue playing',
                    },

                    playlist: true,
                    fullscreen:false,
                },
                dock: {
                    enabled:false,
                    gap: 5,
                    autoHide: false
                }
            },
            onMouseOut:function(){
                console.log('mouse out');
            }
            //canvas: {backgroundGradient: 'none'}
        });
         console.log(this.player);
        //this.player = flowplayer();

    }, 

}

在播放单曲时,它工作正常。但是当我尝试运行播放列表时,第一首曲目播放文件,但是当第一首曲目完成时,它会出现如下错误: -

  VM36229:1 [ERROR] time 13:51:35.968 :: 201, Unable to load stream or clip file, cannot play video: Error #2154, clip: '[Clip] 'mp3:02 Jashn-E-Bahaara-1469775940586.mp3''

播放列表数组示例: -

[{
    url:"mp3:track.mp3",
    provider:"rtmp",
    title:'track title'
  },
  {
    url:"mp3:track1.mp3",
    provider:"rtmp",
    title:'track title1'
  }
  ]

请帮忙。

1 个答案:

答案 0 :(得分:0)

将“duration”传递给剪辑对象解决了这个问题。