﻿var PublicMediaFolder = "/ZksAsura/_Control/Editor/tinymce342/examples/media/";

function FlashPlayer() {

    var _this = this;
    var player = "/ZksAsura/_Control/PlayContral/FLVContral/NewPlayer/ZplayerV3.swf";
    _this.Url = PublicMediaFolder + "sample.flv";
    _this.Width = 425;
    _this.Height = 320;

    _this.UI = function () {

        var html = "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" width=\"" + _this.Width + "\" height=\"" + _this.Height + "\" align=\"middle\">";
        html += "<param name=\"movie\" value=\"" + player + "\" />";
        html += "<param name=\"quality\" value=\"high\" />";
        html += "<param name=\"bgcolor\" value=\"#000000\" />";
        html += "<param name=\"play\" value=\"true\" />";
        html += "<param name=\"loop\" value=\"true\" />";
        html += "<param name=\"wmode\" value=\"transparent\" />";
        //html += "<param name=\"wmode\" value=\"Opaque\">";
        html += "<param name=\"scale\" value=\"showall\" />";
        html += "<param name=\"menu\" value=\"true\" />";
        html += "<param name=\"devicefont\" value=\"false\" />";
        html += "<param name=\"salign\" value=\"\" />";
        html += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
        html += "<param name=\"FlashVars\" value=\"url=" + _this.Url + "\"/>";
        html += "<!--[if !IE]>-->";
        html += "<object type=\"application/x-shockwave-flash\" data=\"" + player + "\" width=\"" + _this.Width + "\" height=\"" + _this.Height + "\">";
        html += "<param name=\"movie\" value=\"" + player + "\" />";
        html += "<param name=\"quality\" value=\"high\" />";
        html += "<param name=\"bgcolor\" value=\"#000000\" />";
        html += "<param name=\"play\" value=\"true\" />";
        html += "<param name=\"loop\" value=\"true\" />";
        html += "<param name=\"wmode\" value=\"transparent\" />";
        html += "<param name=\"scale\" value=\"showall\" />";
        html += "<param name=\"menu\" value=\"true\" />";
        html += "<param name=\"devicefont\" value=\"false\" />";
        html += "<param name=\"salign\" value=\"\" />";
        html += "<param name=\"allowScriptAccess\" value=\"sameDomain\" />";
        html += "<param name=\"FlashVars\" value=\"url=" + _this.Url + "\"/>";
        html += "<!--<![endif]-->";
        html += "<a href=\"http://www.adobe.com/go/getflash\">";
        html += "<img src=\"/zksasura/css/Img/get_flash_player.gif\" alt=\"获得 Adobe Flash Player\" />";
        html += "</a>";
        html += "<!--[if !IE]>-->";
        html += "</object>";
        html += "<!--<![endif]-->";
        html += "</object>";

        return html;

    };
}

function MediaPlayer() {
    var _this = this;
    _this.Url = PublicMediaFolder + "sample.avi";
    _this.Width = 425;
    _this.Height = 320;
    _this.UI = function () {

        var html = "<object id=\"player\" width=\"" + _this.Width + "\" height=\"" + _this.Height + "\"  classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\">";
        //<!--是否自动播放-->";
        html += "<param NAME=\"AutoStart\" VALUE=\"0\">";
        //<!--调整左右声道平衡,同上面旧播放器代码-->
        html += "<param NAME=\"Balance\" VALUE=\"0\">";
        //<!--播放器是否可人为控制-->
        html += "<param name=\"enabled\" value=\"-1\">";
        //<!--是否启用上下文菜单-->
        html += "<param NAME=\"EnableContextMenu\" VALUE=\"-1\">";
        //<!--播放的文件地址-->
        html += "<param NAME=\"url\" value=\"" + _this.Url + "\">";
        //<!--播放次数控制,为整数-->
        html += "<param NAME=\"PlayCount\" VALUE=\"1\">";
        //<!--播放速率控制,1为正常,允许小数,1.0-2.0-->
        html += "<param name=\"rate\" value=\"1\">";
        //<!--控件设置:当前位置-->
        html += "<param name=\"currentPosition\" value=\"0\">";
        //<!--控件设置:当前标记-->
        html += "<param name=\"currentMarker\" value=\"0\">";
        //<!--显示默认框架-->
        html += "<param name=\"defaultFrame\" value=\"\">";
        //<!--脚本命令设置:是否调用URL-->
        html += "<param name=\"invokeURLs\" value=\"0\">";
        //<!--脚本命令设置:被调用的URL-->
        html += "<param name=\"baseURL\" value=\"\">";
        //<!--是否按比例伸展-->
        html += "<param name=\"stretchToFit\" value=\"0\">";
        //<!--默认声音大小0%-100%,50则为50%-->
        html += "<param name=\"volume\" value=\"50\">";
        //<!--是否静音-->
        html += "<param name=\"mute\" value=\"0\">";
        //<!--播放器显示模式:Full显示全部;mini最简化;None不显示播放控制,只显示视频窗口;invisible全部不显示-->
        html += "<param name=\"uiMode\" value=\"mini\">";
        //<!--如果是0可以允许全屏,否则只能在窗口中查看-->
        html += "<param name=\"windowlessVideo\" value=\"0\">";
        //<!--开始播放是否自动全屏-->
        html += "<param name=\"fullScreen\" value=\"0\">";
        //<!--是否启用错误提示报告-->
        html += "<param name=\"enableErrorDialogs\" value=\"-1\">";
        //<!--SAMI样式-->
        html += "<param name=\"SAMIStyle\" value>";
        //<!--SAMI语言-->
        html += "<param name=\"SAMILang\" value>";
        //<!--字幕ID-->
        html += "<param name=\"SAMIFilename\" value>";

        html += "</object>";
        html += "<!--[if !IE]>-->";
        html += "<embed width=\"" + _this.Width + "\" height=\"" + _this.Height + "\" type=\"application/x-mplayer2\"src=\"" + _this.Url + "\"></embed>";
        html += "<!--<![endif]-->";

        return html;


    };
}
