0

我正在尝试为 Subsonic 构建一个 Web 界面,并试图将其 JWPlayer 的默认实现切换为 Flowplayer。

我尝试了在 JWPlayer 和 Flowplayer 中加载视频的默认方法,但都不起作用,所以我查看了使用以下相关代码的现有接口:

var player;
var position;
var maxBitRate = 1000;
var timeOffset = 0;

function init() {
    var flashvars = {
        id:"player1",
        skin:"flash/whotube.zip",
        screencolor:"000000",
        controlbar:"over",
        autostart:"false",
        bufferlength:3,
        backcolor:"EFEFEF",
        frontcolor:"000000",
        provider:"video"
    };
    var params = {
        allowfullscreen:"true",
        allowscriptaccess:"always"
    };
    var attributes = {
        id:"player1",
        name:"player1"
    };

    var width = "100%";
    var height = "85%";
    swfobject.embedSWF("flash/jw-player-5.6.swf", "placeholder1", width, height, "9.0.0", false, flashvars, params, attributes);
}

function playerReady(thePlayer) {
    player = $("player1");
    player.addModelListener("TIME", "timeListener");
    play();    
}

function play() {
    var list = new Array();
    list[0] = {
        file:"http://domain.com:4040/rest/stream.view?u=username&p=password&v=1.6.0&c=appname&id=number",
        duration:9999 - timeOffset, //testing value for duration
        provider:"video"
    };
    player.sendEvent("LOAD", list);
    player.sendEvent("PLAY");
}

我什至不能让任何东西在 flowplayer 下运行。有任何想法吗?我被困在:

  1. 获得与 playerReady() 等价的东西;
  2. 使用以下方法加载视频:

    flowplayer.addClip({'url':videoURL},0); flowplayer.play({'url':videoURL},0);

这给了我:没有方法'addClip'并且没有方法'play'

我的 JS 包括 FlowPlayer 和 JWPlayer:flowplayer-3.2.11.min.js Jquery Prototype swfobject 和我自己的 JS 文件,上面是一个片段。

帮助将不胜感激。

谢谢,

4

1 回答 1

0
flowplayer("player", "flowplayer-3.2.15.swf", {
            clip: {
                scaling: 'orig'
            },
            plugins: {
                controls: null
            },
            // player events are defined directly to "root" (not inside a clip)
            onLoad: function() {
                $f().play({url: "http://pseudo01.hddn.com/vod/demo.flowplayervod/Extremists.flv"});
            }
        });
于 2012-10-13T18:58:53.170 回答