@streamscloud/kit 0.51.1 → 0.52.0
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.
|
@@ -196,6 +196,7 @@ const onTimeUpdate = () => {
|
|
|
196
196
|
}
|
|
197
197
|
percentageCompleted = video.currentTime / video.duration || 0;
|
|
198
198
|
notifyProgress();
|
|
199
|
+
on?.timeUpdate?.({ id, seconds: video.currentTime });
|
|
199
200
|
};
|
|
200
201
|
const onLoaded = () => {
|
|
201
202
|
setVolume(MediaVolumeManager.volumeLevel);
|
|
@@ -238,6 +239,7 @@ const handleSeek = (percent) => {
|
|
|
238
239
|
video.currentTime = video.duration * percent;
|
|
239
240
|
percentageCompleted = percent;
|
|
240
241
|
notifyProgress();
|
|
242
|
+
on?.timeUpdate?.({ id, seconds: video.currentTime });
|
|
241
243
|
}
|
|
242
244
|
};
|
|
243
245
|
</script>
|
|
@@ -38,6 +38,15 @@ type Props = {
|
|
|
38
38
|
}) => void;
|
|
39
39
|
/** Fires on timeupdate with the completion ratio (0-1) */
|
|
40
40
|
progress?: (value: number) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Fires on timeupdate with the raw playback position in seconds. Position-change
|
|
43
|
+
* samples, not a heartbeat: nothing fires while paused, seeks fire once, and a
|
|
44
|
+
* stopped/reset player emits a trailing `seconds: 0`.
|
|
45
|
+
*/
|
|
46
|
+
timeUpdate?: (data: {
|
|
47
|
+
id: string;
|
|
48
|
+
seconds: number;
|
|
49
|
+
}) => void;
|
|
41
50
|
ended?: (data: {
|
|
42
51
|
id: string;
|
|
43
52
|
src: string;
|