Skip to content

Commit 88d0671

Browse files
authored
fix play video not updaing src property (#1129)
1 parent 9dc90d3 commit 88d0671

File tree

4 files changed

+14
-62
lines changed

4 files changed

+14
-62
lines changed

packages/@dcl/inspector/package-lock.json

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/@dcl/inspector/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "@dcl/inspector",
33
"version": "0.1.0",
44
"dependencies": {
5-
"@dcl/asset-packs": "2.4.2",
5+
"@dcl/asset-packs": "2.4.3",
66
"ts-deepmerge": "^7.0.0"
77
},
88
"devDependencies": {

packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/ActionInspector.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,8 @@ const ActionMapOption: Record<string, string> = {
8080
[ActionType.OPEN_LINK]: 'Open Link',
8181
[ActionType.PLAY_AUDIO_STREAM]: 'Play Audio Stream',
8282
[ActionType.STOP_AUDIO_STREAM]: 'Stop Audio Stream',
83-
[ActionType.PLAY_VIDEO_STREAM]: 'Play Video Stream',
84-
[ActionType.STOP_VIDEO_STREAM]: 'Stop Video Stream',
83+
[ActionType.PLAY_VIDEO_STREAM]: 'Play Video',
84+
[ActionType.STOP_VIDEO_STREAM]: 'Stop Video',
8585
[ActionType.SHOW_TEXT]: 'Show Text',
8686
[ActionType.HIDE_TEXT]: 'Hide Text',
8787
[ActionType.START_DELAY]: 'Start Delay',

packages/@dcl/inspector/src/components/EntityInspector/ActionInspector/PlayVideoStreamAction/PlayVideoStreamAction.tsx

Lines changed: 7 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -26,22 +26,6 @@ const playModeOptions = [
2626
}
2727
]
2828

29-
enum VIDEO_SOURCE {
30-
DCL_CAST = 'dcl-cast',
31-
URL = 'url'
32-
}
33-
34-
const videoSourceOptions = [
35-
{
36-
label: 'DCL Cast',
37-
value: VIDEO_SOURCE.DCL_CAST
38-
},
39-
{
40-
label: 'URL',
41-
value: VIDEO_SOURCE.URL
42-
}
43-
]
44-
4529
const PlayVideoStreamAction: React.FC<Props> = ({ value, onUpdate }: Props) => {
4630
const [payload, setPayload] = useState<Partial<ActionPayload<ActionType.PLAY_VIDEO_STREAM>>>({
4731
...value
@@ -52,13 +36,6 @@ const PlayVideoStreamAction: React.FC<Props> = ({ value, onUpdate }: Props) => {
5236
onUpdate(payload)
5337
}, [payload, onUpdate])
5438

55-
const handleChangeVideoSource = useCallback(
56-
({ target: { value } }: React.ChangeEvent<HTMLSelectElement>) => {
57-
setPayload({ ...payload, dclCast: value === VIDEO_SOURCE.DCL_CAST })
58-
},
59-
[payload, setPayload]
60-
)
61-
6239
const handleChangeSrc = useCallback(
6340
({ target: { value } }: React.ChangeEvent<HTMLInputElement>) => {
6441
setPayload({ ...payload, src: value })
@@ -96,42 +73,17 @@ const PlayVideoStreamAction: React.FC<Props> = ({ value, onUpdate }: Props) => {
9673

9774
return (
9875
<div className="PlayVideoStreamActionContainer">
76+
<Block>
77+
<TextField label={<>URL {renderUrlInfo()}</>} value={payload.src} onChange={handleChangeSrc} autoSelect />
78+
</Block>
9979
<Block>
10080
<Dropdown
101-
label="Video Source"
102-
value={payload.dclCast ? VIDEO_SOURCE.DCL_CAST : VIDEO_SOURCE.URL}
103-
options={videoSourceOptions}
104-
onChange={handleChangeVideoSource}
105-
info={
106-
payload.dclCast && (
107-
<>
108-
DCL Cast only works when your scene is deployed to a World.{' '}
109-
<a
110-
href="https://docs.decentraland.org/creator/development-guide/sdk7/video-playing/#streaming-using-decentraland-cast"
111-
target="_blank"
112-
>
113-
Learn More
114-
</a>
115-
</>
116-
)
117-
}
81+
label="Play Mode"
82+
value={payload.loop ? PLAY_MODE.LOOP : PLAY_MODE.PLAY_ONCE}
83+
options={playModeOptions}
84+
onChange={handleChangePlayMode}
11885
/>
11986
</Block>
120-
{!payload.dclCast ? (
121-
<>
122-
<Block>
123-
<TextField label={<>URL {renderUrlInfo()}</>} value={payload.src} onChange={handleChangeSrc} autoSelect />
124-
</Block>
125-
<Block>
126-
<Dropdown
127-
label="Play Mode"
128-
value={payload.loop ? PLAY_MODE.LOOP : PLAY_MODE.PLAY_ONCE}
129-
options={playModeOptions}
130-
onChange={handleChangePlayMode}
131-
/>
132-
</Block>
133-
</>
134-
) : null}
13587
<Block>
13688
<RangeField
13789
label="Volume"

0 commit comments

Comments
 (0)