@cqa-lib/cqa-ui 1.1.226 → 1.1.227
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.
|
@@ -14924,13 +14924,12 @@ class SimulatorComponent {
|
|
|
14924
14924
|
this.playerState = 'paused';
|
|
14925
14925
|
this.videoPause.emit();
|
|
14926
14926
|
this.isVideoPlayingChange.emit(false);
|
|
14927
|
-
// Switch to next video and
|
|
14927
|
+
// Switch to next video and auto-play it
|
|
14928
14928
|
if (this.hasMultipleVideos && this.videoUrls && this.currentVideoIndex < this.videoUrls.length - 1) {
|
|
14929
|
-
this.currentVideoIndex
|
|
14929
|
+
const nextIndex = this.currentVideoIndex + 1;
|
|
14930
14930
|
this.enqueueOperation(() => __awaiter(this, void 0, void 0, function* () {
|
|
14931
14931
|
var _a;
|
|
14932
|
-
yield this.
|
|
14933
|
-
yield new Promise(resolve => setTimeout(resolve, 100));
|
|
14932
|
+
yield this.switchToVideoAndResetInternal(nextIndex);
|
|
14934
14933
|
if (((_a = this.vplayer) === null || _a === void 0 ? void 0 : _a.nativeElement) && this.currentVideoUrl) {
|
|
14935
14934
|
yield this.playVideoInternal();
|
|
14936
14935
|
}
|
|
@@ -15451,31 +15450,23 @@ class SimulatorComponent {
|
|
|
15451
15450
|
this.playPromise = null;
|
|
15452
15451
|
this.videoPause.emit();
|
|
15453
15452
|
this.isVideoPlayingChange.emit(false);
|
|
15454
|
-
|
|
15455
|
-
|
|
15456
|
-
|
|
15457
|
-
|
|
15458
|
-
if (resolved)
|
|
15453
|
+
const metadataLoaded = new Promise((resolve, reject) => {
|
|
15454
|
+
let settled = false;
|
|
15455
|
+
const settle = (fn) => {
|
|
15456
|
+
if (settled)
|
|
15459
15457
|
return;
|
|
15460
|
-
|
|
15458
|
+
settled = true;
|
|
15461
15459
|
video.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
15462
15460
|
video.removeEventListener('error', onError);
|
|
15461
|
+
fn();
|
|
15463
15462
|
};
|
|
15464
|
-
const onLoadedMetadata = () =>
|
|
15465
|
-
|
|
15466
|
-
|
|
15467
|
-
};
|
|
15468
|
-
const onError = () => {
|
|
15469
|
-
cleanup();
|
|
15470
|
-
reject(new Error('Failed to load video'));
|
|
15471
|
-
};
|
|
15472
|
-
setTimeout(() => {
|
|
15473
|
-
if (resolved)
|
|
15474
|
-
return;
|
|
15475
|
-
video.addEventListener('loadedmetadata', onLoadedMetadata, { once: true });
|
|
15476
|
-
video.addEventListener('error', onError, { once: true });
|
|
15477
|
-
}, 100);
|
|
15463
|
+
const onLoadedMetadata = () => settle(resolve);
|
|
15464
|
+
const onError = () => settle(() => reject(new Error('Failed to load video')));
|
|
15465
|
+
video.addEventListener('loadedmetadata', onLoadedMetadata, { once: true });
|
|
15466
|
+
video.addEventListener('error', onError, { once: true });
|
|
15478
15467
|
});
|
|
15468
|
+
this.currentVideoIndex = targetVideoIndex;
|
|
15469
|
+
yield metadataLoaded;
|
|
15479
15470
|
video.currentTime = 0;
|
|
15480
15471
|
this.progress = 0;
|
|
15481
15472
|
this.playPromise = null;
|
|
@@ -15526,31 +15517,23 @@ class SimulatorComponent {
|
|
|
15526
15517
|
this.playPromise = null;
|
|
15527
15518
|
this.videoPause.emit();
|
|
15528
15519
|
this.isVideoPlayingChange.emit(false);
|
|
15529
|
-
|
|
15530
|
-
|
|
15531
|
-
|
|
15532
|
-
|
|
15533
|
-
if (resolved)
|
|
15520
|
+
const metadataLoaded = new Promise((resolve, reject) => {
|
|
15521
|
+
let settled = false;
|
|
15522
|
+
const settle = (fn) => {
|
|
15523
|
+
if (settled)
|
|
15534
15524
|
return;
|
|
15535
|
-
|
|
15525
|
+
settled = true;
|
|
15536
15526
|
video.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
15537
15527
|
video.removeEventListener('error', onError);
|
|
15528
|
+
fn();
|
|
15538
15529
|
};
|
|
15539
|
-
const onLoadedMetadata = () =>
|
|
15540
|
-
|
|
15541
|
-
|
|
15542
|
-
};
|
|
15543
|
-
const onError = () => {
|
|
15544
|
-
cleanup();
|
|
15545
|
-
reject(new Error('Failed to load video'));
|
|
15546
|
-
};
|
|
15547
|
-
setTimeout(() => {
|
|
15548
|
-
if (resolved)
|
|
15549
|
-
return;
|
|
15550
|
-
video.addEventListener('loadedmetadata', onLoadedMetadata, { once: true });
|
|
15551
|
-
video.addEventListener('error', onError, { once: true });
|
|
15552
|
-
}, 100);
|
|
15530
|
+
const onLoadedMetadata = () => settle(resolve);
|
|
15531
|
+
const onError = () => settle(() => reject(new Error('Failed to load video')));
|
|
15532
|
+
video.addEventListener('loadedmetadata', onLoadedMetadata, { once: true });
|
|
15533
|
+
video.addEventListener('error', onError, { once: true });
|
|
15553
15534
|
});
|
|
15535
|
+
this.currentVideoIndex = targetVideoIndex;
|
|
15536
|
+
yield metadataLoaded;
|
|
15554
15537
|
const seekSeconds = relativeTimestamp / 1000;
|
|
15555
15538
|
const targetTime = Math.max(0, Math.min(seekSeconds, video.duration || seekSeconds));
|
|
15556
15539
|
yield new Promise((resolve) => {
|