diff --git a/package.json b/package.json index 5595209..98ea513 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/index.ts b/src/index.ts index 150c032..9ca273f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -4,7 +4,7 @@ import { IVLabsPlayer, PlayerConfig, CuePoint, Translations, AnalyticsEvent, Ana /** * Props for the InteractiveVideo component. */ -export interface InteractiveVideoProps extends Omit { +export interface InteractiveVideoProps extends Omit { /** * The URL of the video to be loaded. */ @@ -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. @@ -72,7 +76,7 @@ export default defineComponent({ setup(props, { attrs, expose }) { const containerRef = ref(null); const playerRef = ref(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(() => {