Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@interactive-video-labs/vue",
"version": "0.0.5",
"version": "0.0.6",
"type": "module",
"description": "Thin Vue wrapper for the @interactive-video-labs/core engine. Enables cue-based interactive video playback in Vue 3 applications.",
"main": "dist/index.cjs",
Expand Down
8 changes: 6 additions & 2 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IVLabsPlayer, PlayerConfig, CuePoint, Translations, AnalyticsEvent, Ana
/**
* Props for the InteractiveVideo component.
*/
export interface InteractiveVideoProps extends Omit<PlayerConfig, 'videoUrl' | 'cues' | 'translations'> {
export interface InteractiveVideoProps extends Omit<PlayerConfig, 'videoUrl' | 'cues' | 'translations' | 'targetElementId'> {
/**
* The URL of the video to be loaded.
*/
Expand Down Expand Up @@ -61,6 +61,10 @@ export default defineComponent({
* The locale to be used for the player.
*/
locale: { type: String, default: 'en' },
/**
* The ID of the target HTML element where the player will be mounted.
*/
targetElementId: { type: String },
},
/**
* The setup function for the component.
Expand All @@ -72,7 +76,7 @@ export default defineComponent({
setup(props, { attrs, expose }) {
const containerRef = ref<HTMLDivElement | null>(null);
const playerRef = ref<IVLabsPlayer | null>(null);
const uniqueId = `ivlabs-player-${Math.random().toString(36).substr(2, 9)}`;
const uniqueId = props.targetElementId || `ivlabs-player-${Math.random().toString(36).substr(2, 9)}`;

// Initialize player only after the component is mounted and the DOM is ready
onMounted(() => {
Expand Down