Поправлена логика применения autoplay из различных источников

This commit is contained in:
Алексей Манаев
2025-08-29 19:19:19 +00:00
parent 20caaeb6e6
commit 3c1406ad77
5 changed files with 11 additions and 5 deletions
+4
View File
@@ -0,0 +1,4 @@
{
"cleanUrls": false,
"trailingSlash": false
}
+1 -1
View File
@@ -13,5 +13,5 @@ if ! npx --no-install serve -v >/dev/null 2>&1; then
fi
# Запускаем локальный сервер на 5000 порту (или любой другой)
echo "[VOKA] Starting server at http://localhost:8080"
echo "[VOKA] Starting server port 8080"
serve -s demo -l 8080
+4 -2
View File
@@ -399,8 +399,9 @@ namespace VokaCorePlayer {
playableContent['adv'] = content.adv
playableContent['subtitlesUrl'] = content.subtitlesUrl
this.autoPlayOption = content.streamOptions?.autoplay
this.setupAutoplay(this.autoPlayOption)
if (content.streamOptions?.autoplay != null) {
this.autoPlayOption = content.streamOptions?.autoplay
}
this.player.src(playableContent)
// hls.js в процессе работы может менять исходник на blob, а такое
@@ -701,6 +702,7 @@ namespace VokaCorePlayer {
if (autoplay === "muted") {
autoplayValue = "muted";
} else if (this.isLive) {
// Для лайв всегда форсируем автоплей (бизнес правила Voka)
autoplayValue = true;
} else {
autoplayValue = JSON.parse(autoplay);
+1 -1
View File
@@ -200,7 +200,7 @@ namespace VokaOptions {
}
export interface IStream {
autoplay: boolean
autoplay: boolean | "muted" | any
drmConfig: IDRMConfig | null
metrics: IMetrics | null
heartbeat: IHeartbeat | null
+1 -1
View File
@@ -197,7 +197,7 @@ export class VokaPlayerImpl implements IVokaPlayer {
enable: options.controls.editing.enable
}
},
autoplay: (BrowserUtils.getLocationParam('autoplay') || (options.streamOpts && options.streamOpts.autoplay) || 'false'),
autoplay: (BrowserUtils.getLocationParam('autoplay') || (options.streamOpts && options.streamOpts.autoplay) || false),
log: options.log,
bus: this.bus,
loggerId: options.loggerId