码迷,mamicode.com
首页 > 其他好文 > 详细

视频播放功能

时间:2015-01-06 19:46:37      阅读:187      评论:0      收藏:0      [点我收藏+]

标签:

HTML代码:

<div>
    <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0"
        width="960" height="472" id="cc_8F6EE4CA8E8900349C33DC5901307461">
        <param name="movie" value="http://p.bokecc.com/flash/single/F26B5136373BAF7D_3B6247971B35F50E9C33DC5901307461_false_21DFD364E7B3CCF9_1/player.swf">
        <param name="allowFullScreen" value="true">
        <param name="allowScriptAccess" value="always">
        <param value="transparent" name="wmode">
        <embed id="player" name="player" src="http://p.bokecc.com/flash/single/F26B5136373BAF7D_3B6247971B35F50E9C33DC5901307461_false_21DFD364E7B3CCF9_1/player.swf"
            width="960" height="472" name="cc_8F6EE4CA8E8900349C33DC5901307461" allowfullscreen="true"
            allowscriptaccess="always" pluginspage="http://www.macromedia.com/go/getflashplayer"
            type="application/x-shockwave-flash"></object>
   
</div>

  javascript代码:

function isIE() {
    if (window.navigator.userAgent.toString().toLowerCase().indexOf("msie") >= 1)
        return true;
    else
        return false;
}

  

function on_spark_player_start() {
    bflag = jQuery("#userInfoflag").attr("value");
    if (bflag == "False") {
        jQuery(".warn-tc").css("display", "block");
        showBg();
        on_spark_player_resume();
        jQuery(".videostartvalidation").bind("click", function () {
            javascript: location.reload();
        })
    }
    else {
        var errorcountcurrent = parseInt(jQuery(".errorcount").attr("data_errorcount"));
        if (errorcountcurrent >= maxerrorcount) {
            return;
        }
        loopfunction = setInterval("play_time()", 1000);
    }
}
function on_spark_player_resume() {
    if (!isIE()) {
        document.getElementById("player").spark_player_pause();
    }
    else {
        document.getElementById("cc_8F6EE4CA8E8900349C33DC5901307461").spark_player_pause();
    }
}

  

function play_time() {
    var currentTime;
    var totaltime
    if (!isIE()) {
        currentTime = parseInt(document.getElementById("player").spark_player_position());
        totaltime = parseInt(document.getElementById("player").spark_player_duration());
        //document.getElementById("player").spark_player_pause();
    }
    else {
        currentTime = parseInt(document.getElementById("cc_8F6EE4CA8E8900349C33DC5901307461").spark_player_position());
        totaltime = parseInt(document.getElementById("cc_8F6EE4CA8E8900349C33DC5901307461").spark_player_duration());
        // document.getElementById("cc_8F6EE4CA8E8900349C33DC5901307461").spark_player_pause();
    }

    if (currentTime == totaltime) {
        clearInterval(loopfunction);
        showBg();
        jQuery(".questionsdialog").css("display", "block");
    }
}

  

视频播放功能

标签:

原文地址:http://www.cnblogs.com/sunzhenyong/p/4206609.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!