(function() {
var vplayer_id = 'c218f2d1-5152-43f9-ae95-eae4f1b91649';
var vplayer_player_id = "player-c218f2d1-5152-43f9-ae95-eae4f1b91649";
var vplayer_title = "米下院、法輪功保護法案通過―中共の信じがたい犯罪だ/蘇州で日本人母子刺傷事件 中共プロパガンダと関連か など|NTD ワールドウォッチ(2024年6月28日)";
var vplayer_m3u8 = 'https://vod.brightchat.com/assets/c218f2d1-5152-43f9-ae95-eae4f1b91649/playlist.m3u8';
var vplayer_duration = 773;
var vplayer_poster = 'https://vod.brightchat.com/assets/2024/0628/c218f2d1-5152-43f9-ae95-eae4f1b91649/thumbnail_h_1719567684005.jpg';
var vplayer_ratio = "16:9";
var vplayer_autostart = true;
var vplayer_mute = true;
var vplayer_ads = true;
var vplayer_init = true;
var vplayer_logo = false;
var vplayer_controls = true;
var vplayer_schedule_time = 1719567742;
var vplayer_premiere = 0;
var vplayer_channel_uid = "fa017bb4-7c83-4fb6-9503-35f21d17ef9a";
var vplayer_live = "0";
var vplayer_tracking = true;
var vplayer_api_host = 'stat.brightchat.org';
var vplayer_assets_host = "vod.brightchat.com";
var vplayer_live_host = "live.brightchat.com";
var vplayer_adTagUrl = "";
if (typeof videojs === "undefined") {
var css = [
"//" + vplayer_assets_host + "/static/assets/css/vplayer.css?ver=15.2",
];
for (var m = 0; m < css.length; m++) {
var css_link = document.createElement("link");
css_link.rel = "stylesheet";
css_link.type = "text/css";
css_link.href = css[m];
document.head.appendChild(css_link);
}
var scripts = [
"//" + vplayer_assets_host + "/static/assets/js/epochplayer7.min.js?ver=12",
"//" + vplayer_assets_host + "/static/assets/js/vplayer.min.js?ver=15.10",
];
if (vplayer_ads) {
load_script("//imasdk.googleapis.com/js/sdkloader/ima3.js", true, false);
scripts.push(
"//" + vplayer_assets_host + "/static/assets/js/epochplayer7.ads.min.js"
);
}
for (var i = 0; i < scripts.length; i++) {
load_script(scripts[i], false, i == scripts.length - 1 ? true : false);
}
} else {
load_player();
}
function load_script(url, is_async, is_callback) {
var script = document.createElement("script");
script.src = url;
script.async = is_async;
document.body.appendChild(script);
if (is_callback) {
script.addEventListener("load", function () {
load_player();
});
}
}
function load_player() {
var playerIns = videojs.getPlayer(vplayer_player_id);
if (typeof playerIns !== "undefined") {
playerIns.dispose();
}
var player_container_html =
'';
if (videojs.browser.IE_VERSION) {
player_container_html =
'';
}
var player_container = document.getElementById(
"player-container-" + vplayer_id
);
if (player_container) {
player_container.innerHTML = player_container_html;
}
var player = videojs(vplayer_player_id, {
liveui: true,
errorDisplay: false,
mute: vplayer_mute,
aspectRatio: vplayer_ratio,
poster: vplayer_poster,
controls: vplayer_controls,
controlBar: {
pictureInPictureToggle: false,
},
html5: {
hls: {
cacheEncryptionKeys: true,
},
},
});
player.setting({
tracking: vplayer_tracking,
apiHost: vplayer_api_host ? 'https://' + vplayer_api_host : '',
assetsHost: vplayer_assets_host ? 'https://' + vplayer_assets_host : '',
});
if (vplayer_premiere == 1) {
vplayer_ads = false;
var finishTime = vplayer_schedule_time + vplayer_duration * 1;
player.premiere({
scheduleTime: vplayer_schedule_time * 1000,
finishTime: finishTime * 1000,
videoId: vplayer_id,
videoSrc: vplayer_m3u8,
thumbnail: vplayer_poster,
});
} else if (vplayer_live == 1 && !vplayer_m3u8) {
vplayer_ads = false;
player.one("live_end_reload", function () {
setTimeout(function () {
var head = document.getElementsByTagName("head")[0];
var script = document.createElement("script");
script.src =
"https://" +
vplayer_assets_host +
"/static/assets/player/" +
vplayer_id +
"?api=7&noads=true";
head.appendChild(script);
}, 1000);
});
player.live({
videoId: vplayer_id,
liveHost:vplayer_live_host? 'https://' + vplayer_live_host : '',
scheduleTime: vplayer_schedule_time * 1000,
});
} else {
player.src({
type: "application/x-mpegURL",
src: vplayer_m3u8,
});
if (vplayer_autostart) {
player.autoplay(vplayer_mute ? "muted" : "play");
}
}
if (
typeof player.ima === "function" &&
typeof google !== "undefined" &&
vplayer_ads &&
vplayer_adTagUrl
) {
if (!vplayer_adTagUrl.startsWith("http")) {
var vplayer_referrer_url = encodeURI(window.location.href);
vplayer_adTagUrl =
"https://pubads.g.doubleclick.net/gampad/ads?sz=640x480&impl=s&gdfp_req=1&env=vp&output=vast&unviewed_position_start=1&url=" +
vplayer_referrer_url +
"&description_url=" +
vplayer_referrer_url +
"&correlator=[timestamp]&iu=" +
vplayer_adTagUrl +
"&pageurl=__page-url__";
}
player.ima({
adTagUrl: vplayer_adTagUrl,
adsManagerLoadedCallback: function () {
player.ima.addEventListener(
google.ima.AdEvent.Type.SKIPPED,
function () {
player.el().focus();
}
);
player.ima.addEventListener(
google.ima.AdEvent.Type.CONTENT_RESUME_REQUESTED,
function () {
if (player.remainingTime() > 3 && player.paused()) {
var promise = player.play();
if (promise && promise.catch) {
promise.catch(function (error) {
console.log("CONTENT_RESUME_REQUESTED");
player.muted(true);
player.play();
player.getChild("unmuteButton").removeClass("vjs-hidden");
});
}
}
}
);
},
});
}
}
})();