expanded for TV devices
This commit is contained in:
@@ -191,6 +191,11 @@ function isMobilePlayback() {
|
|||||||
return window.matchMedia('(pointer: coarse)').matches && window.matchMedia('(max-width: 900px)').matches;
|
return window.matchMedia('(pointer: coarse)').matches && window.matchMedia('(max-width: 900px)').matches;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function isTvPlayback() {
|
||||||
|
const ua = navigator.userAgent || '';
|
||||||
|
return /SMART-TV|SmartTV|Smart TV|Internet\.TV|HbbTV|NetCast|Web0S|webOS|Tizen|AppleTV|Apple TV|GoogleTV|Android TV|AFTB|AFTS|AFTM|AFTT|AFTQ|AFTK|AFTN|AFTMM|AFTKR|Roku|DTV|BRAVIA|VIZIO|SHIELD|PhilipsTV|Hisense|VIDAA|TOSHIBA/i.test(ua);
|
||||||
|
}
|
||||||
|
|
||||||
function getMobileVideoHost() {
|
function getMobileVideoHost() {
|
||||||
let host = document.getElementById('mobile-video-host');
|
let host = document.getElementById('mobile-video-host');
|
||||||
if (!host) {
|
if (!host) {
|
||||||
@@ -261,7 +266,7 @@ function showError(message) {
|
|||||||
async function openPlayer(url) {
|
async function openPlayer(url) {
|
||||||
const modal = document.getElementById('video-modal');
|
const modal = document.getElementById('video-modal');
|
||||||
const video = document.getElementById('player');
|
const video = document.getElementById('player');
|
||||||
const useMobileFullscreen = isMobilePlayback();
|
const useMobileFullscreen = isMobilePlayback() || isTvPlayback();
|
||||||
let playbackStarted = false;
|
let playbackStarted = false;
|
||||||
|
|
||||||
if (!playerHome) {
|
if (!playerHome) {
|
||||||
|
|||||||
Reference in New Issue
Block a user