﻿function Videoplaybox_OnReouterHTML(tagName) {
    // 显示视频播放器
    var arrPlaybox = document.getElementsByName(tagName);
    if (arrPlaybox != null && arrPlaybox.length > 0) {
        for (i = 0; i < arrPlaybox.length; i++) {
            if (arrPlaybox[i].src == "about:blank") {
                var nWidth = arrPlaybox[i].width;
                var nHeight = arrPlaybox[i].height;
                var nVid = arrPlaybox[i].vid;
                var nAllowfullscreen = arrPlaybox[i].allowfullscreen;
                arrPlaybox[i].outerHTML = "<embed id=\"vPlaybox\" name=\"vPlaybox\" width=\"" + nWidth + "\" height=\"" + nHeight + "\" src=\"http://v.ku6vms.com/phpvms/player/html/vid/" + nVid + "/style/bu3ff9JnseE./\" type=\"application/x-shockwave-flash\" quality=\"high\" allowscriptaccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowfullscreen=\"" + nAllowfullscreen + "\">";
            } else {
                //var nSrc = arrPlaybox[i].src;
                //if (nSrc.indexOf("http://img.ku6.com/common/supev/200809271532/player.swf?vid=", 0) == 0) {
                //    var nSrcArray = nSrc.split("?");
                //    nSrc = nSrcArray[0] + "?" + Math.random() + "&" + nSrcArray[1];
                //    var nWidth = arrPlaybox[i].width;
                //    var nHeight = arrPlaybox[i].height;
                //    var nAllowfullscreen = arrPlaybox[i].allowfullscreen;
                //   arrPlaybox[i].outerHTML = "<embed id=\"vPlaybox\" name=\"vPlaybox\" width=\"" + nWidth + "\" height=\"" + nHeight + "\" src=\"" + nSrc + "\" type=\"application/x-shockwave-flash\" quality=\"high\" allowscriptaccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowfullscreen=\"" + nAllowfullscreen + "\">";
                //}
            }
        }
    }
}

// 旧视频平台播放方式
//function Videoplaybox_OnReouterHTML(tagName) {
//    // 显示视频播放器
//    var arrPlaybox = document.getElementsByName(tagName);
//    if (arrPlaybox != null && arrPlaybox.length > 0) {
//        for (i = 0; i < arrPlaybox.length; i++) {
//            if (arrPlaybox[i].src == "about:blank") {
//                var nWidth = arrPlaybox[i].width;
//                var nHeight = arrPlaybox[i].height;
//                var nFlashvars = arrPlaybox[i].flashvars;
//                var nAllowfullscreen = arrPlaybox[i].allowfullscreen;
//                arrPlaybox[i].outerHTML = "<embed id=\"vPlaybox\" name=\"vPlaybox\" width=\"" + nWidth + "\" height=\"" + nHeight + "\" src=\"http://img.ku6.com/common/supev/200809271532/player.swf?" + Math.random() + "\" type=\"application/x-shockwave-flash\" quality=\"high\" flashvars=\"" + nFlashvars + "&amp;auto=0\" allowscriptaccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowfullscreen=\"" + nAllowfullscreen + "\">";
//            } else {
//                var nSrc = arrPlaybox[i].src;
//                if (nSrc.indexOf("http://img.ku6.com/common/supev/200809271532/player.swf?vid=", 0) == 0) {
//                    var nSrcArray = nSrc.split("?");
//                    nSrc = nSrcArray[0] + "?" + Math.random() + "&" + nSrcArray[1];
//                    var nWidth = arrPlaybox[i].width;
//                    var nHeight = arrPlaybox[i].height;
//                    var nAllowfullscreen = arrPlaybox[i].allowfullscreen;
//                    arrPlaybox[i].outerHTML = "<embed id=\"vPlaybox\" name=\"vPlaybox\" width=\"" + nWidth + "\" height=\"" + nHeight + "\" src=\"" + nSrc + "\" type=\"application/x-shockwave-flash\" quality=\"high\" allowscriptaccess=\"always\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" allowfullscreen=\"" + nAllowfullscreen + "\">";
//                }
//            }
//        }
//    }
//}

