Spaces:
Running
Running
Upload static/vtv_init.js
Browse files- static/vtv_init.js +4 -5
static/vtv_init.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
| 1 |
-
// ===== VNEWS VTV Player
|
| 2 |
(function() {
|
| 3 |
if (window._vtvInitLoaded) return;
|
| 4 |
window._vtvInitLoaded = true;
|
|
@@ -166,7 +166,7 @@
|
|
| 166 |
}
|
| 167 |
}
|
| 168 |
|
| 169 |
-
// ===== Switch channel — iframe
|
| 170 |
window._vtvProSwitch = function(chId) {
|
| 171 |
_currentCh = chId;
|
| 172 |
|
|
@@ -191,13 +191,12 @@
|
|
| 191 |
xhr.onload = function() {
|
| 192 |
try {
|
| 193 |
var data = JSON.parse(xhr.responseText);
|
| 194 |
-
//
|
| 195 |
-
var iframeUrl = data.
|
| 196 |
if (!iframeUrl) {
|
| 197 |
frame.innerHTML = '<div class="vtv-pro-err"><div class="icon">📡</div><div class="msg">Kênh không khả dụng</div><button onclick="_vtvProSwitch(\''+chId+'\')">Thử lại</button></div>';
|
| 198 |
return;
|
| 199 |
}
|
| 200 |
-
// Iframe luôn vừa khung player (aspect-ratio 16/9)
|
| 201 |
var iframe = document.createElement('iframe');
|
| 202 |
iframe.src = iframeUrl;
|
| 203 |
iframe.setAttribute('allowfullscreen', 'true');
|
|
|
|
| 1 |
+
// ===== VNEWS VTV Player v10 — SV2 iframe trực tiếp =====
|
| 2 |
(function() {
|
| 3 |
if (window._vtvInitLoaded) return;
|
| 4 |
window._vtvInitLoaded = true;
|
|
|
|
| 166 |
}
|
| 167 |
}
|
| 168 |
|
| 169 |
+
// ===== Switch channel — SV2 iframe trực tiếp =====
|
| 170 |
window._vtvProSwitch = function(chId) {
|
| 171 |
_currentCh = chId;
|
| 172 |
|
|
|
|
| 191 |
xhr.onload = function() {
|
| 192 |
try {
|
| 193 |
var data = JSON.parse(xhr.responseText);
|
| 194 |
+
// Dùng iframe_url trực tiếp từ SV2 — player thật, mobile/desktop đều được
|
| 195 |
+
var iframeUrl = data.iframe_url;
|
| 196 |
if (!iframeUrl) {
|
| 197 |
frame.innerHTML = '<div class="vtv-pro-err"><div class="icon">📡</div><div class="msg">Kênh không khả dụng</div><button onclick="_vtvProSwitch(\''+chId+'\')">Thử lại</button></div>';
|
| 198 |
return;
|
| 199 |
}
|
|
|
|
| 200 |
var iframe = document.createElement('iframe');
|
| 201 |
iframe.src = iframeUrl;
|
| 202 |
iframe.setAttribute('allowfullscreen', 'true');
|