mirror of
https://github.com/KuekHaoYang/KVideo.git
synced 2026-08-16 17:23:43 +08:00
fix: player UX, ad fingerprinting, Android TV 9 white screen
Address issues #217 #218 and integrate the useful parts of PR #219 without regressions: stop player rebuild on episode reverse, grid/paged episodes, poster placeholders, chrome69 client transpile for Amlogic WebView, and duration-signature ad block detection while keeping interstitial/proxy filters. Bump to 4.9.15.
This commit is contained in:
@@ -4,8 +4,11 @@ import { promises as fs } from 'node:fs';
|
||||
import path from 'node:path';
|
||||
import { transform } from 'esbuild';
|
||||
|
||||
const TARGET = 'chrome83';
|
||||
const UNSUPPORTED_LOGICAL_ASSIGNMENT = /(\?\?=|\|\|=|&&=)/;
|
||||
// Android 9 / Amlogic TV WebViews are often Chrome 66–74.
|
||||
// chrome83 still emits `??` (Chrome 80+), which white-screens those devices.
|
||||
const TARGET = 'chrome69';
|
||||
// Logical assignment + nullish coalescing + optional chaining break old WebViews.
|
||||
const UNSUPPORTED_MODERN_SYNTAX = /(\?\?=|\|\|=|&&=|\?\?|\?\.)/;
|
||||
|
||||
async function pathExists(filePath) {
|
||||
try {
|
||||
@@ -47,8 +50,8 @@ async function transpileFile(filePath) {
|
||||
|
||||
await fs.writeFile(filePath, result.code);
|
||||
|
||||
if (UNSUPPORTED_LOGICAL_ASSIGNMENT.test(result.code)) {
|
||||
throw new Error(`${filePath} still contains logical assignment syntax after ${TARGET} transpilation.`);
|
||||
if (UNSUPPORTED_MODERN_SYNTAX.test(result.code)) {
|
||||
throw new Error(`${filePath} still contains modern syntax unsupported by ${TARGET} after transpilation.`);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user