/**
 * Add a video material to an object
 * @example
 * ```
  const cube = getPrefab({ p: [0, 0, 6] });
  addVideo(cube, { src: 'https://cdn.hibervr.com/video/bike.mp4' });
  addTo(root, cube);
 * ```
 */
export const addVideo = (target, options) => {
    const videoProp = {
        videoUrl: options.src ?? '',
        emissiveStrength: options.emissiveStrength ?? 0.9,
        startPlayingAtTimeSecs: options.startPlayingAtTimeSecs ?? 0.9,
    };
    target.videoTexture = videoProp;
    if (target.children) {
        for (const child of target.children) {
            addVideo(child, options);
        }
    }
    return target;
};
//# sourceMappingURL=addVideo.js.map