Video SDK Type and Version
Type: Web
Version: 2.3.0
Description
After updating the Web SDK from 2.2.12 to 2.3.0, my React app no longer attaches video correctly. Instead of a <video> element, it attaches a <div>, so the video does not display.
The 2.3.0 release notes mention this fix:
Potential memory leaks when using
stream.attachVideo()andstream.attachShareView()methods.
Could this be why it works differently now?
This is how I attach it in the jsx:
<video-player-container>
<video-player ref={ref} data-user-id={userId} />
</video-player-container>
My attach function:
attachVideoPlayer: async (userId: number, element: VideoPlayer) => {
const player = await stream().attachVideo(userId, VideoQuality.Video_720P, element)
}
These are my custom elements:
type CustomElement<T> = Partial<T & DOMAttributes<T> & { children?: any }>
declare module 'react' {
namespace JSX {
interface IntrinsicElements {
'video-player': DetailedHTMLProps<HTMLAttributes<VideoPlayer>, VideoPlayer> & {
class?: string
}
'video-player-container': CustomElement<VideoPlayerContainer> & { class?: string }
}
}
}
Error?
No error message appears in the console.
Troubleshooting Routes
I tried installing the latest version (2.3.5), and I still have the same issue.
I checked the attached element after running the attachVideo function.
In 2.2.12 it attaches a video:
<video-player data-user-id="" node-id="" media-type="video" video-quality="3" style="display: block;">
<video autoplay="true" muted="true" playsinline="true" style="width: 100%; height: 100%; border-radius: inherit;"></video>
</video-player>
In 2.3.0 it attaches a div:
<video-player data-user-id="" node-id="" media-type="video" style="display: block;" data-video-player-id="" video-quality="3">
<div style="width: 100%; height: 100%; position: relative; border-radius: inherit;">
<div style="width: 100%; height: 100%;"></div>
</div>
</video-player>
How To Reproduce
Browser: Chrome 143.0.7499.194
- Install version 2.2.12
- Join meeting
- Inspect the generated video-player element
- Repeat with version 2.3.0