@coxwave/tap-kit-types 2.0.9 → 2.1.1
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.
- package/dist/index.d.ts +26 -7
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -2647,9 +2647,25 @@ type ContainerVisibility = "open" | "closed";
|
|
|
2647
2647
|
*
|
|
2648
2648
|
* @example
|
|
2649
2649
|
* ```typescript
|
|
2650
|
-
*
|
|
2650
|
+
* // Simple adapter (backward compatible)
|
|
2651
|
+
* const simpleAdapter: VideoPlayerAdapter = {
|
|
2651
2652
|
* getCurrentTime: () => player.currentTime,
|
|
2652
|
-
* setCurrentTime: (time) => {
|
|
2653
|
+
* setCurrentTime: (time) => {
|
|
2654
|
+
* player.currentTime = time;
|
|
2655
|
+
* }
|
|
2656
|
+
* };
|
|
2657
|
+
*
|
|
2658
|
+
* // Cross-clip seeking adapter (recommended)
|
|
2659
|
+
* const crossClipAdapter: VideoPlayerAdapter = {
|
|
2660
|
+
* getCurrentTime: () => player.currentTime,
|
|
2661
|
+
* setCurrentTime: (time, clipId) => {
|
|
2662
|
+
* // clipId enables cross-clip seeking (e.g., jump to different lecture)
|
|
2663
|
+
* if (clipId && clipId !== currentClipId) {
|
|
2664
|
+
* loadClip(clipId).then(() => player.currentTime = time);
|
|
2665
|
+
* } else {
|
|
2666
|
+
* player.currentTime = time;
|
|
2667
|
+
* }
|
|
2668
|
+
* }
|
|
2653
2669
|
* };
|
|
2654
2670
|
* ```
|
|
2655
2671
|
*/
|
|
@@ -2659,9 +2675,9 @@ interface VideoPlayerAdapter {
|
|
|
2659
2675
|
/**
|
|
2660
2676
|
* Set playback time in seconds
|
|
2661
2677
|
* @param time - Playback time in seconds
|
|
2662
|
-
* @param clipId - ClipId from the seek request (for cross-clip seeking)
|
|
2678
|
+
* @param clipId - ClipId from the seek request (for cross-clip seeking). Optional for backward compatibility.
|
|
2663
2679
|
*/
|
|
2664
|
-
setCurrentTime: (time: number, clipId
|
|
2680
|
+
setCurrentTime: (time: number, clipId?: string) => void;
|
|
2665
2681
|
}
|
|
2666
2682
|
/**
|
|
2667
2683
|
* Video Player Configuration
|
|
@@ -2673,10 +2689,13 @@ interface VideoPlayerAdapter {
|
|
|
2673
2689
|
* const videoElement = document.querySelector('video');
|
|
2674
2690
|
* sdk.video.bind(videoElement); // clipId from SDK config, auto-updates with setCourse()
|
|
2675
2691
|
*
|
|
2676
|
-
* // Custom Adapter
|
|
2677
|
-
* const adapter = {
|
|
2692
|
+
* // Custom Adapter (YouTube, Vimeo, etc.)
|
|
2693
|
+
* const adapter: VideoPlayerAdapter = {
|
|
2678
2694
|
* getCurrentTime: () => player.currentTime,
|
|
2679
|
-
* setCurrentTime: (time) => {
|
|
2695
|
+
* setCurrentTime: (time, clipId) => {
|
|
2696
|
+
* // clipId enables cross-clip seeking (e.g., jump to different lecture)
|
|
2697
|
+
* player.currentTime = time;
|
|
2698
|
+
* }
|
|
2680
2699
|
* };
|
|
2681
2700
|
* sdk.video.bind(adapter);
|
|
2682
2701
|
*
|