无法将mp4视频添加到高清到sd流播放器脚本

时间:2014-05-16 22:09:51

标签: javascript flash flowplayer

我想使用此流播放器脚本:sample

我有2个视频,一个是sd(X.mp4),第二个是高清(X.hd.mp4)视频

我想要相同的功能,但只需要我的视频。

bellow是我的javascript代码

<script>

flowplayer("httpstreaming-hd", "http://releases.flowplayer.org/swf/flowplayer-3.2.18.swf", { plugins: {

    f4m: { url: "flowplayer.f4m-3.2.10.swf" },

    httpstreaming: { url: "flowplayer.httpstreaming-3.2.11.swf" },

    // the "tube" skin
    controls: { url: "flowplayer.controls-tube-3.2.16.swf"},
    bitrateselect: {
        url: "flowplayer.bitrateselect-3.2.14.swf",

        // show the HD button only in the controlbar
        hdButton: { place: 'controls'},

        // show the selected file in a content box
        // usually omitted in production
        onStreamSwitchBegin: function (newItem, currentItem) {
            $f("httpstreaming-hd").getPlugin('content').setHtml("Will switch to: " +
                newItem.streamName + " from " + currentItem.streamName);
        },
        onStreamSwitch: function (newItem) {
            $f("httpstreaming-hd").getPlugin('content').setHtml("Switched to: " +
                newItem.streamName);
        }
    },
    // a content box to display the selected bitrate
    // usually omitted in production
    content: {
        url: "flowplayer.content-3.2.9.swf",
        bottom: 30,
        left: 0,
        width: 420,
        height: 150,
        backgroundColor: 'transparent',
        backgroundGradient: 'none',
        border: 0,
        textDecoration: 'outline',
        style: {
            body: {
                fontSize: 14,
                fontFamily: 'Arial',
                textAlign: 'center',
                color: '#ffffff'
            }
        }
    }
},
clip: {
    url: "sample2.f4m",
    provider: 'httpstreaming',

    // we need 2 urlResolvers
    urlResolvers: ['f4m','bitrateselect'],

    // directory where the manifest and video fragments are stored
    baseUrl: "http://stream.flowplayer.org/httpstreaming/",

    autoPlay: false,

    // configuring the sd and hd properties is mandatory
    bitrates: [
        { url : 'video/vid.mp4' ,bitrate: 500, label: '500k', sd: true},
        {url : 'video/vid.hd.mp4' , bitrate: 1500, label: '1500k', hd: true}
    ]

} ,
playlist: {  'url': 'video/vid.mp4', 'provider': 'httpstreaming', 'main_video': true }

});

f4m: { url: "flowplayer.f4m-3.2.10.swf" }, httpstreaming: { url: "flowplayer.httpstreaming-3.2.11.swf" }, // the "tube" skin controls: { url: "flowplayer.controls-tube-3.2.16.swf"}, bitrateselect: { url: "flowplayer.bitrateselect-3.2.14.swf", // show the HD button only in the controlbar hdButton: { place: 'controls'}, // show the selected file in a content box // usually omitted in production onStreamSwitchBegin: function (newItem, currentItem) { $f("httpstreaming-hd").getPlugin('content').setHtml("Will switch to: " + newItem.streamName + " from " + currentItem.streamName); }, onStreamSwitch: function (newItem) { $f("httpstreaming-hd").getPlugin('content').setHtml("Switched to: " + newItem.streamName); } }, // a content box to display the selected bitrate // usually omitted in production content: { url: "flowplayer.content-3.2.9.swf", bottom: 30, left: 0, width: 420, height: 150, backgroundColor: 'transparent', backgroundGradient: 'none', border: 0, textDecoration: 'outline', style: { body: { fontSize: 14, fontFamily: 'Arial', textAlign: 'center', color: '#ffffff' } } } }, clip: { url: "sample2.f4m", provider: 'httpstreaming', // we need 2 urlResolvers urlResolvers: ['f4m','bitrateselect'], // directory where the manifest and video fragments are stored baseUrl: "http://stream.flowplayer.org/httpstreaming/", autoPlay: false, // configuring the sd and hd properties is mandatory bitrates: [ { url : 'video/vid.mp4' ,bitrate: 500, label: '500k', sd: true}, {url : 'video/vid.hd.mp4' , bitrate: 1500, label: '1500k', hd: true} ] } , playlist: { 'url': 'video/vid.mp4', 'provider': 'httpstreaming', 'main_video': true }
提前谢谢。

0 个答案:

没有答案