itube-specs 0.0.782 → 0.0.783
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -59,19 +59,21 @@ let advancing = false;
|
|
|
59
59
|
|
|
60
60
|
function onAdvanceRequest(payload: AdvanceRequest): void {
|
|
61
61
|
if (payload.direction === 'previous') return;
|
|
62
|
-
//
|
|
63
|
-
if (payload.direction === 'ended' && playerRef.value?.player && !playerRef.value.player.autoAdvance) return;
|
|
64
|
-
|
|
62
|
+
// Переключаемся всегда (грузим следующий ролик); автоплей решаем в onSourceChange.
|
|
65
63
|
advancing = true;
|
|
66
64
|
emit('advance', payload);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
|
-
// player.load() сам не стартует воспроизведение.
|
|
70
|
-
//
|
|
67
|
+
// player.load() сам не стартует воспроизведение. По sourcechange после нашего перехода
|
|
68
|
+
// доигрываем play() — но только при включённом тумблере Autoplay. Выключен → следующий
|
|
69
|
+
// ролик (и по next, и по окончании) только загружается и ждёт play от пользователя.
|
|
71
70
|
function onSourceChange(): void {
|
|
72
71
|
if (!advancing) return;
|
|
73
72
|
advancing = false;
|
|
74
|
-
|
|
73
|
+
|
|
74
|
+
if (playerRef.value?.player?.autoAdvance) {
|
|
75
|
+
playerRef.value.player.play();
|
|
76
|
+
}
|
|
75
77
|
}
|
|
76
78
|
|
|
77
79
|
// Наша иконка play (public/img/play.svg) — для опции icons плеер ждёт сырой <svg>.
|