149 lines
3.4 KiB
YAML
149 lines
3.4 KiB
YAML
task_id: task_create_component_audio_player
|
|
entity_id: component_audio_player
|
|
generated_at: '2025-12-18T15:16:50.310377'
|
|
workflow_version: v001
|
|
target:
|
|
type: component
|
|
definition:
|
|
id: component_audio_player
|
|
name: AudioPlayer
|
|
description: Global audio player with full controls
|
|
props:
|
|
- name: currentSong
|
|
type: Song
|
|
required: false
|
|
- name: queue
|
|
type: array[Song]
|
|
required: false
|
|
- name: autoplay
|
|
type: boolean
|
|
default: false
|
|
state:
|
|
- name: isPlaying
|
|
type: boolean
|
|
- name: currentTime
|
|
type: number
|
|
- name: volume
|
|
type: number
|
|
- name: isShuffle
|
|
type: boolean
|
|
- name: repeatMode
|
|
type: enum[off, one, all]
|
|
events:
|
|
- name: onPlay
|
|
payload:
|
|
songId: string
|
|
- name: onPause
|
|
payload: null
|
|
- name: onSeek
|
|
payload:
|
|
time: number
|
|
- name: onVolumeChange
|
|
payload:
|
|
volume: number
|
|
- name: onNext
|
|
payload: null
|
|
- name: onPrevious
|
|
payload: null
|
|
- name: onShuffle
|
|
payload: null
|
|
- name: onRepeat
|
|
payload: null
|
|
uses_apis:
|
|
- api_increment_play_count
|
|
uses_components:
|
|
- component_waveform_display
|
|
- component_player_controls
|
|
related:
|
|
models: []
|
|
apis:
|
|
- id: api_increment_play_count
|
|
definition: &id002
|
|
id: api_increment_play_count
|
|
method: POST
|
|
path: /api/songs/:id/play
|
|
description: Increment play count
|
|
request_body: null
|
|
responses:
|
|
- status: 200
|
|
description: Play count incremented
|
|
schema:
|
|
play_count: integer
|
|
auth:
|
|
required: false
|
|
depends_on_models:
|
|
- model_song
|
|
components:
|
|
- id: component_waveform_display
|
|
definition: &id001
|
|
id: component_waveform_display
|
|
name: WaveformDisplay
|
|
description: Audio waveform visualization
|
|
props:
|
|
- name: audioUrl
|
|
type: string
|
|
required: true
|
|
- name: waveformData
|
|
type: array[number]
|
|
required: false
|
|
- name: currentTime
|
|
type: number
|
|
required: false
|
|
events:
|
|
- name: onSeek
|
|
payload:
|
|
time: number
|
|
uses_apis: []
|
|
uses_components: []
|
|
- id: component_player_controls
|
|
definition: &id003
|
|
id: component_player_controls
|
|
name: PlayerControls
|
|
description: Play/pause/seek controls
|
|
props:
|
|
- name: isPlaying
|
|
type: boolean
|
|
required: true
|
|
- name: currentTime
|
|
type: number
|
|
required: true
|
|
- name: duration
|
|
type: number
|
|
required: true
|
|
events:
|
|
- name: onPlay
|
|
payload: null
|
|
- name: onPause
|
|
payload: null
|
|
- name: onSeek
|
|
payload:
|
|
time: number
|
|
uses_apis: []
|
|
uses_components: []
|
|
dependencies:
|
|
entity_ids:
|
|
- component_waveform_display
|
|
- api_increment_play_count
|
|
- component_player_controls
|
|
definitions:
|
|
- id: component_waveform_display
|
|
type: component
|
|
definition: *id001
|
|
- id: api_increment_play_count
|
|
type: api
|
|
definition: *id002
|
|
- id: component_player_controls
|
|
type: component
|
|
definition: *id003
|
|
files:
|
|
to_create:
|
|
- app/components/AudioPlayer.tsx
|
|
reference: []
|
|
acceptance:
|
|
- criterion: Component renders without errors
|
|
verification: Import and render in test
|
|
- criterion: Props are typed correctly
|
|
verification: TypeScript compilation
|
|
- criterion: Events fire correctly
|
|
verification: Test event handlers
|