Skip to content

Commit 7bafaec

Browse files
committed
Fix setting properties of undefined error in background.
1 parent 41cf430 commit 7bafaec

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@api.stream/studio-kit",
3-
"version": "3.0.43",
3+
"version": "3.0.44",
44
"description": "Client SDK for building studio experiences with API.stream",
55
"license": "MIT",
66
"private": false,

src/core/transforms/Background.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,12 +110,14 @@ export const Background = {
110110
if (videoRef.current) {
111111
videoRef.current!.src = src
112112
videoRef.current!.play().catch(() => {
113-
videoRef.current.muted = true
114-
videoRef.current.play()
113+
if (videoRef.current) {
114+
videoRef.current.muted = true
115+
videoRef.current.play()
116+
}
115117
})
116118
if (hasPermission(role, Permission.UpdateProject)) {
117119
interval = setInterval(() => {
118-
if (videoRef.current.duration) {
120+
if (videoRef.current?.duration) {
119121
const timePending =
120122
videoRef.current.duration - videoRef.current.currentTime
121123
trigger('VideoTimeUpdate', {

0 commit comments

Comments
 (0)