Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Commit

Permalink
fix audio and media node editors (#10338)
Browse files Browse the repository at this point in the history
Co-authored-by: Daniel Belmes <[email protected]>
  • Loading branch information
aditya-mitra and DanielBelmes authored Jun 7, 2024
1 parent 0913e03 commit ba24e32
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 15 deletions.
3 changes: 2 additions & 1 deletion packages/client-core/i18n/en/editor.json
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,8 @@
"lbl-currentTime": "Current Time",
"lbl-isMusic": "Is Music",
"lbl-size": "Size",
"seektime": "Start Time"
"seektime": "Start Time",
"lbl-mediaControls": "Media Controls"
},
"mesh": {
"name": "Mesh",
Expand Down
10 changes: 6 additions & 4 deletions packages/ui/src/components/editor/properties/media/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ export const MediaNodeEditor: EditorComponentType = (props) => {
/>
</InputGroup>

<InputGroup name="Start Time" label={t('editor:properties.media.seekTime')}>
<InputGroup name="Start Time" label={t('editor:properties.media.seektime')}>
<NumericInput
value={media.seekTime.value}
onChange={updateProperty(MediaComponent, 'seekTime')}
Expand Down Expand Up @@ -156,11 +156,13 @@ export const MediaNodeEditor: EditorComponentType = (props) => {
/>
</InputGroup>
{media.resources.length > 0 && (
<InputGroup name="media-controls" label="media-controls">
<Button onClick={toggle}>
<InputGroup name="media-controls" label={t('editor:properties.media.lbl-mediaControls')} className="gap-2">
<Button variant="outline" onClick={toggle}>
{media.paused.value ? t('editor:properties.media.playtitle') : t('editor:properties.media.pausetitle')}
</Button>
<Button onClick={reset}>{t('editor:properties.media.resettitle')}</Button>
<Button variant="outline" onClick={reset}>
{t('editor:properties.media.resettitle')}
</Button>
</InputGroup>
)}
</NodeEditor>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,22 +28,20 @@ import { useTranslation } from 'react-i18next'
import { PiSpeakerLowLight } from 'react-icons/pi'

import { hasComponent, useComponent } from '@etherealengine/ecs/src/ComponentFunctions'
import { PositionalAudioComponent } from '@etherealengine/engine/src/audio/components/PositionalAudioComponent'
import { DistanceModel, DistanceModelOptions } from '@etherealengine/engine/src/audio/constants/AudioConstants'

import {
EditorComponentType,
commitProperty,
updateProperty
} from '@etherealengine/editor/src/components/properties/Util'
import { EditorControlFunctions } from '@etherealengine/editor/src/functions/EditorControlFunctions'
import { SelectionState } from '@etherealengine/editor/src/services/SelectionServices'
import { PositionalAudioComponent } from '@etherealengine/engine/src/audio/components/PositionalAudioComponent'
import { DistanceModel, DistanceModelOptions } from '@etherealengine/engine/src/audio/constants/AudioConstants'
import { MediaComponent } from '@etherealengine/engine/src/scene/components/MediaComponent'
import { VolumetricComponent } from '@etherealengine/engine/src/scene/components/VolumetricComponent'
import Slider from '../../../../primitives/tailwind/Slider'
import InputGroup from '../../input/Group'
import NumericInput from '../../input/Numeric'
import ProgressBar from '../../input/Progress'
import SelectInput from '../../input/Select'
import NodeEditor from '../nodeEditor'

Expand All @@ -69,7 +67,6 @@ export const PositionalAudioNodeEditor: EditorComponentType = (props) => {
description={t('editor:properties.audio.description')}
icon={<PiSpeakerLowLight />}
>
<ProgressBar value={5} paused={false} totalTime={100} />
<InputGroup
name="Distance Model"
label={t('editor:properties.audio.lbl-distanceModel')}
Expand All @@ -78,10 +75,7 @@ export const PositionalAudioNodeEditor: EditorComponentType = (props) => {
<SelectInput
key={props.entity}
options={DistanceModelOptions}
value={
//audioComponent.distanceModel.value
''
}
value={audioComponent.distanceModel.value}
onChange={commitProperty(PositionalAudioComponent, 'distanceModel')}
/>
</InputGroup>
Expand Down
2 changes: 1 addition & 1 deletion packages/ui/src/primitives/tailwind/Slider/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const Slider = ({ value, min = 0, max = 100, step = 1, width = 200, onChange, on
}

return (
<div className="flex items-center gap-2">
<div className="flex flex-wrap items-center gap-2">
<input
min={min}
max={max}
Expand Down

0 comments on commit ba24e32

Please sign in to comment.