@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.
|
@@ -15003,12 +15003,11 @@ class SimulatorComponent {
|
|
|
15003
15003
|
this.playerState = 'paused';
|
|
15004
15004
|
this.videoPause.emit();
|
|
15005
15005
|
this.isVideoPlayingChange.emit(false);
|
|
15006
|
-
// Switch to next video and
|
|
15006
|
+
// Switch to next video and auto-play it
|
|
15007
15007
|
if (this.hasMultipleVideos && this.videoUrls && this.currentVideoIndex < this.videoUrls.length - 1) {
|
|
15008
|
-
this.currentVideoIndex
|
|
15008
|
+
const nextIndex = this.currentVideoIndex + 1;
|
|
15009
15009
|
this.enqueueOperation(async () => {
|
|
15010
|
-
await this.
|
|
15011
|
-
await new Promise(resolve => setTimeout(resolve, 100));
|
|
15010
|
+
await this.switchToVideoAndResetInternal(nextIndex);
|
|
15012
15011
|
if (this.vplayer?.nativeElement && this.currentVideoUrl) {
|
|
15013
15012
|
await this.playVideoInternal();
|
|
15014
15013
|
}
|
|
@@ -15518,31 +15517,23 @@ class SimulatorComponent {
|
|
|
15518
15517
|
this.playPromise = null;
|
|
15519
15518
|
this.videoPause.emit();
|
|
15520
15519
|
this.isVideoPlayingChange.emit(false);
|
|
15521
|
-
|
|
15522
|
-
|
|
15523
|
-
|
|
15524
|
-
|
|
15525
|
-
if (resolved)
|
|
15520
|
+
const metadataLoaded = new Promise((resolve, reject) => {
|
|
15521
|
+
let settled = false;
|
|
15522
|
+
const settle = (fn) => {
|
|
15523
|
+
if (settled)
|
|
15526
15524
|
return;
|
|
15527
|
-
|
|
15525
|
+
settled = true;
|
|
15528
15526
|
video.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
15529
15527
|
video.removeEventListener('error', onError);
|
|
15528
|
+
fn();
|
|
15530
15529
|
};
|
|
15531
|
-
const onLoadedMetadata = () =>
|
|
15532
|
-
|
|
15533
|
-
|
|
15534
|
-
};
|
|
15535
|
-
const onError = () => {
|
|
15536
|
-
cleanup();
|
|
15537
|
-
reject(new Error('Failed to load video'));
|
|
15538
|
-
};
|
|
15539
|
-
setTimeout(() => {
|
|
15540
|
-
if (resolved)
|
|
15541
|
-
return;
|
|
15542
|
-
video.addEventListener('loadedmetadata', onLoadedMetadata, { once: true });
|
|
15543
|
-
video.addEventListener('error', onError, { once: true });
|
|
15544
|
-
}, 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 });
|
|
15545
15534
|
});
|
|
15535
|
+
this.currentVideoIndex = targetVideoIndex;
|
|
15536
|
+
await metadataLoaded;
|
|
15546
15537
|
video.currentTime = 0;
|
|
15547
15538
|
this.progress = 0;
|
|
15548
15539
|
this.playPromise = null;
|
|
@@ -15590,31 +15581,23 @@ class SimulatorComponent {
|
|
|
15590
15581
|
this.playPromise = null;
|
|
15591
15582
|
this.videoPause.emit();
|
|
15592
15583
|
this.isVideoPlayingChange.emit(false);
|
|
15593
|
-
|
|
15594
|
-
|
|
15595
|
-
|
|
15596
|
-
|
|
15597
|
-
if (resolved)
|
|
15584
|
+
const metadataLoaded = new Promise((resolve, reject) => {
|
|
15585
|
+
let settled = false;
|
|
15586
|
+
const settle = (fn) => {
|
|
15587
|
+
if (settled)
|
|
15598
15588
|
return;
|
|
15599
|
-
|
|
15589
|
+
settled = true;
|
|
15600
15590
|
video.removeEventListener('loadedmetadata', onLoadedMetadata);
|
|
15601
15591
|
video.removeEventListener('error', onError);
|
|
15592
|
+
fn();
|
|
15602
15593
|
};
|
|
15603
|
-
const onLoadedMetadata = () =>
|
|
15604
|
-
|
|
15605
|
-
|
|
15606
|
-
};
|
|
15607
|
-
const onError = () => {
|
|
15608
|
-
cleanup();
|
|
15609
|
-
reject(new Error('Failed to load video'));
|
|
15610
|
-
};
|
|
15611
|
-
setTimeout(() => {
|
|
15612
|
-
if (resolved)
|
|
15613
|
-
return;
|
|
15614
|
-
video.addEventListener('loadedmetadata', onLoadedMetadata, { once: true });
|
|
15615
|
-
video.addEventListener('error', onError, { once: true });
|
|
15616
|
-
}, 100);
|
|
15594
|
+
const onLoadedMetadata = () => settle(resolve);
|
|
15595
|
+
const onError = () => settle(() => reject(new Error('Failed to load video')));
|
|
15596
|
+
video.addEventListener('loadedmetadata', onLoadedMetadata, { once: true });
|
|
15597
|
+
video.addEventListener('error', onError, { once: true });
|
|
15617
15598
|
});
|
|
15599
|
+
this.currentVideoIndex = targetVideoIndex;
|
|
15600
|
+
await metadataLoaded;
|
|
15618
15601
|
const seekSeconds = relativeTimestamp / 1000;
|
|
15619
15602
|
const targetTime = Math.max(0, Math.min(seekSeconds, video.duration || seekSeconds));
|
|
15620
15603
|
await new Promise((resolve) => {
|