0
# Media Components
1
2
Multimedia components for handling audio, video, camera, live streaming, and image display functionality.
3
4
## Capabilities
5
6
### Image
7
8
Image display component with lazy loading, error handling, and various display modes.
9
10
```typescript { .api }
11
/**
12
* Image display component with lazy loading
13
* @supported all platforms
14
*/
15
const Image: ComponentType<ImageProps>;
16
17
interface ImageProps extends StandardProps {
18
/** Image source URL or local path
19
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
20
*/
21
src?: string;
22
/** Image display mode
23
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
24
* @default "scaleToFill"
25
*/
26
mode?: keyof ImageProps.Mode;
27
/** Whether to enable lazy loading
28
* @supported weapp, alipay, swan, tt, qq, jd, h5
29
* @default false
30
*/
31
lazyLoad?: boolean;
32
/** Whether to enable fade-in animation
33
* @supported weapp, tt, qq, jd
34
* @default true
35
*/
36
fadeIn?: boolean;
37
/** Whether to enable webp format
38
* @supported weapp, tt, qq, jd
39
* @default false
40
*/
41
webp?: boolean;
42
/** Whether to show menu on long press
43
* @supported weapp, tt, qq, jd
44
* @default true
45
*/
46
showMenuByLongpress?: boolean;
47
/** Image load callback */
48
onLoad?: (event: ImageLoadEvent) => void;
49
/** Image error callback */
50
onError?: (event: ImageErrorEvent) => void;
51
}
52
53
declare namespace ImageProps {
54
interface Mode {
55
/** Scale to fill the container */
56
scaleToFill: '';
57
/** Scale maintaining aspect ratio */
58
aspectFit: '';
59
/** Scale to fill, may crop */
60
aspectFill: '';
61
/** Keep original size centered */
62
center: '';
63
/** Top alignment */
64
top: '';
65
/** Bottom alignment */
66
bottom: '';
67
/** Left alignment */
68
left: '';
69
/** Right alignment */
70
right: '';
71
/** Top left alignment */
72
'top left': '';
73
/** Top right alignment */
74
'top right': '';
75
/** Bottom left alignment */
76
'bottom left': '';
77
/** Bottom right alignment */
78
'bottom right': '';
79
}
80
}
81
```
82
83
### Video
84
85
Video player component with full controls and platform-specific features.
86
87
```typescript { .api }
88
/**
89
* Video player component with full controls
90
* @supported all platforms
91
*/
92
const Video: ComponentType<VideoProps>;
93
94
interface VideoProps extends StandardProps {
95
/** Video source URL
96
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
97
*/
98
src?: string;
99
/** Video duration in seconds
100
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
101
*/
102
duration?: number;
103
/** Whether controls are shown
104
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
105
* @default true
106
*/
107
controls?: boolean;
108
/** Whether to enable danmu (bullet comments)
109
* @supported weapp, tt, qq, jd
110
* @default false
111
*/
112
danmuBtn?: boolean;
113
/** Whether to enable full screen
114
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
115
* @default true
116
*/
117
enableFullScreen?: boolean;
118
/** Whether to autoplay
119
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
120
* @default false
121
*/
122
autoplay?: boolean;
123
/** Whether to loop playback
124
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
125
* @default false
126
*/
127
loop?: boolean;
128
/** Whether to mute
129
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
130
* @default false
131
*/
132
muted?: boolean;
133
/** Initial playback time
134
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
135
* @default 0
136
*/
137
initialTime?: number;
138
/** Page gesture for full screen
139
* @supported weapp, tt, qq, jd
140
* @default false
141
*/
142
pageGesture?: boolean;
143
/** Full screen direction
144
* @supported weapp, tt, qq, jd
145
* @default 90
146
*/
147
direction?: number;
148
/** Whether to show progress
149
* @supported weapp, tt, qq, jd
150
* @default true
151
*/
152
showProgress?: boolean;
153
/** Whether to show fullscreen button
154
* @supported weapp, tt, qq, jd
155
* @default true
156
*/
157
showFullscreenBtn?: boolean;
158
/** Whether to show play button
159
* @supported weapp, tt, qq, jd
160
* @default true
161
*/
162
showPlayBtn?: boolean;
163
/** Whether to show center play button
164
* @supported weapp, tt, qq, jd
165
* @default true
166
*/
167
showCenterPlayBtn?: boolean;
168
/** Whether to enable progress gesture
169
* @supported weapp, tt, qq, jd
170
* @default true
171
*/
172
enableProgressGesture?: boolean;
173
/** Object fit mode
174
* @supported weapp, tt, qq, jd
175
* @default "contain"
176
*/
177
objectFit?: 'contain' | 'fill' | 'cover';
178
/** Poster image URL
179
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
180
*/
181
poster?: string;
182
/** Whether to show mute button
183
* @supported weapp, tt, qq, jd
184
* @default false
185
*/
186
showMuteBtn?: boolean;
187
/** Video title
188
* @supported weapp, tt, qq, jd
189
*/
190
title?: string;
191
/** Play button position
192
* @supported weapp, tt, qq, jd
193
* @default "bottom"
194
*/
195
playBtnPosition?: 'bottom' | 'center';
196
/** Whether to enable play gesture
197
* @supported weapp, tt, qq, jd
198
* @default false
199
*/
200
enablePlayGesture?: boolean;
201
/** Whether to auto pause other videos
202
* @supported weapp, tt, qq, jd
203
* @default true
204
*/
205
autoPauseIfNavigate?: boolean;
206
/** Whether to auto pause when opening app
207
* @supported weapp, tt, qq, jd
208
* @default true
209
*/
210
autoPauseIfOpenNative?: boolean;
211
/** Video metadata load callback */
212
onLoadedMetadata?: (event: VideoLoadedMetadataEvent) => void;
213
/** Video play callback */
214
onPlay?: (event: TaroEvent) => void;
215
/** Video pause callback */
216
onPause?: (event: TaroEvent) => void;
217
/** Video end callback */
218
onEnded?: (event: TaroEvent) => void;
219
/** Video time update callback */
220
onTimeUpdate?: (event: VideoTimeUpdateEvent) => void;
221
/** Video fullscreen change callback */
222
onFullscreenChange?: (event: VideoFullscreenChangeEvent) => void;
223
/** Video waiting callback */
224
onWaiting?: (event: TaroEvent) => void;
225
/** Video error callback */
226
onError?: (event: VideoErrorEvent) => void;
227
/** Video progress callback */
228
onProgress?: (event: VideoProgressEvent) => void;
229
}
230
```
231
232
### Audio
233
234
Audio player component for audio content playback.
235
236
```typescript { .api }
237
/**
238
* Audio player component
239
* @supported all platforms
240
*/
241
const Audio: ComponentType<AudioProps>;
242
243
interface AudioProps extends StandardProps {
244
/** Audio ID for referencing
245
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
246
*/
247
id?: string;
248
/** Audio source URL
249
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
250
*/
251
src?: string;
252
/** Whether to loop playback
253
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn, harmony_hybrid
254
* @default false
255
*/
256
loop?: boolean;
257
/** Whether controls are shown
258
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
259
* @default false
260
*/
261
controls?: boolean;
262
/** Poster image URL
263
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
264
*/
265
poster?: string;
266
/** Audio name
267
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
268
*/
269
name?: string;
270
/** Audio author
271
* @supported weapp, alipay, swan, tt, qq, jd, h5, rn
272
*/
273
author?: string;
274
/** Audio error callback */
275
onError?: (event: AudioErrorEvent) => void;
276
/** Audio play callback */
277
onPlay?: (event: TaroEvent) => void;
278
/** Audio pause callback */
279
onPause?: (event: TaroEvent) => void;
280
/** Audio time update callback */
281
onTimeUpdate?: (event: AudioTimeUpdateEvent) => void;
282
/** Audio end callback */
283
onEnded?: (event: TaroEvent) => void;
284
}
285
```
286
287
### Camera
288
289
Camera capture component for photo and video recording.
290
291
```typescript { .api }
292
/**
293
* Camera capture component
294
* @supported weapp, alipay, swan, tt, qq, jd, rn
295
*/
296
const Camera: ComponentType<CameraProps>;
297
298
interface CameraProps extends StandardProps {
299
/** Camera mode
300
* @supported weapp, alipay, swan, tt, qq, jd, rn
301
* @default "normal"
302
*/
303
mode?: 'normal' | 'scanCode';
304
/** Resolution mode
305
* @supported weapp, tt, qq, jd
306
* @default "medium"
307
*/
308
resolution?: 'low' | 'medium' | 'high';
309
/** Camera facing direction
310
* @supported weapp, alipay, swan, tt, qq, jd, rn
311
* @default "back"
312
*/
313
devicePosition?: 'front' | 'back';
314
/** Whether flash is enabled
315
* @supported weapp, alipay, swan, tt, qq, jd, rn
316
* @default "auto"
317
*/
318
flash?: 'auto' | 'on' | 'off' | 'torch';
319
/** Frame size for scan mode
320
* @supported weapp, tt, qq, jd
321
* @default "medium"
322
*/
323
frameSize?: 'small' | 'medium' | 'large';
324
/** Camera ready callback */
325
onReady?: (event: TaroEvent) => void;
326
/** Camera stop callback */
327
onStop?: (event: TaroEvent) => void;
328
/** Camera error callback */
329
onError?: (event: CameraErrorEvent) => void;
330
/** Scan code callback */
331
onScanCode?: (event: CameraScanCodeEvent) => void;
332
}
333
```
334
335
### Live Streaming Components
336
337
Components for live video streaming functionality.
338
339
```typescript { .api }
340
/**
341
* Live video player component
342
* @supported weapp, alipay, swan, tt, qq, jd
343
*/
344
const LivePlayer: ComponentType<LivePlayerProps>;
345
346
interface LivePlayerProps extends StandardProps {
347
/** Live stream source URL
348
* @supported weapp, alipay, swan, tt, qq, jd
349
*/
350
src?: string;
351
/** Play mode
352
* @supported weapp, alipay, swan, tt, qq, jd
353
* @default "live"
354
*/
355
mode?: 'live' | 'RTC';
356
/** Whether autoplay is enabled
357
* @supported weapp, alipay, swan, tt, qq, jd
358
* @default false
359
*/
360
autoplay?: boolean;
361
/** Whether mute is enabled
362
* @supported weapp, alipay, swan, tt, qq, jd
363
* @default false
364
*/
365
muted?: boolean;
366
/** Orientation mode
367
* @supported weapp, alipay, swan, tt, qq, jd
368
* @default "vertical"
369
*/
370
orientation?: 'vertical' | 'horizontal';
371
/** Object fit mode
372
* @supported weapp, alipay, swan, tt, qq, jd
373
* @default "contain"
374
*/
375
objectFit?: 'contain' | 'fillCrop';
376
/** Background mute policy
377
* @supported weapp, tt, qq, jd
378
* @default 1
379
*/
380
backgroundMute?: number;
381
/** Minimum cache time in seconds
382
* @supported weapp, tt, qq, jd
383
* @default 1
384
*/
385
minCache?: number;
386
/** Maximum cache time in seconds
387
* @supported weapp, tt, qq, jd
388
* @default 3
389
*/
390
minCache?: number;
391
/** Sound mode
392
* @supported weapp, tt, qq, jd
393
* @default "speaker"
394
*/
395
soundMode?: 'speaker' | 'ear';
396
/** Auto pause when navigate back
397
* @supported weapp, tt, qq, jd
398
* @default true
399
*/
400
autoPauseIfNavigate?: boolean;
401
/** Auto pause when open native app
402
* @supported weapp, tt, qq, jd
403
* @default true
404
*/
405
autoPauseIfOpenNative?: boolean;
406
/** Player state change callback */
407
onStateChange?: (event: LivePlayerStateChangeEvent) => void;
408
/** Full screen change callback */
409
onFullScreenChange?: (event: LivePlayerFullScreenChangeEvent) => void;
410
/** Net status callback */
411
onNetStatus?: (event: LivePlayerNetStatusEvent) => void;
412
/** Audio volume notify callback */
413
onAudioVolumeNotify?: (event: LivePlayerAudioVolumeNotifyEvent) => void;
414
}
415
416
/**
417
* Live video streaming component
418
* @supported weapp, alipay, swan, tt, qq, jd
419
*/
420
const LivePusher: ComponentType<LivePusherProps>;
421
422
interface LivePusherProps extends StandardProps {
423
/** Stream push URL
424
* @supported weapp, alipay, swan, tt, qq, jd
425
*/
426
url?: string;
427
/** Push mode
428
* @supported weapp, alipay, swan, tt, qq, jd
429
* @default "RTC"
430
*/
431
mode?: 'SD' | 'HD' | 'FHD' | 'RTC';
432
/** Whether autopush is enabled
433
* @supported weapp, alipay, swan, tt, qq, jd
434
* @default false
435
*/
436
autopush?: boolean;
437
/** Whether mute is enabled
438
* @supported weapp, alipay, swan, tt, qq, jd
439
* @default false
440
*/
441
muted?: boolean;
442
/** Whether to enable camera
443
* @supported weapp, alipay, swan, tt, qq, jd
444
* @default true
445
*/
446
enableCamera?: boolean;
447
/** Whether to auto focus
448
* @supported weapp, alipay, swan, tt, qq, jd
449
* @default true
450
*/
451
autoFocus?: boolean;
452
/** Orientation
453
* @supported weapp, alipay, swan, tt, qq, jd
454
* @default "vertical"
455
*/
456
orientation?: 'vertical' | 'horizontal';
457
/** Beauty filter level
458
* @supported weapp, alipay, swan, tt, qq, jd
459
* @default 0
460
*/
461
beauty?: number;
462
/** Whiteness filter level
463
* @supported weapp, alipay, swan, tt, qq, jd
464
* @default 0
465
*/
466
whiteness?: number;
467
/** Video aspect ratio
468
* @supported weapp, alipay, swan, tt, qq, jd
469
* @default "9:16"
470
*/
471
aspect?: '9:16' | '3:4';
472
/** Minimum bit rate
473
* @supported weapp, tt, qq, jd
474
* @default 200
475
*/
476
minBitrate?: number;
477
/** Maximum bit rate
478
* @supported weapp, tt, qq, jd
479
* @default 1000
480
*/
481
maxBitrate?: number;
482
/** Audio quality
483
* @supported weapp, tt, qq, jd
484
* @default "high"
485
*/
486
audioQuality?: 'high' | 'low';
487
/** Waiting image URL
488
* @supported weapp, tt, qq, jd
489
*/
490
waitingImage?: string;
491
/** Waiting image hash
492
* @supported weapp, tt, qq, jd
493
*/
494
waitingImageHash?: string;
495
/** Zoom level
496
* @supported weapp, tt, qq, jd
497
* @default 0
498
*/
499
zoom?: number;
500
/** Camera device position
501
* @supported weapp, alipay, swan, tt, qq, jd
502
* @default "front"
503
*/
504
devicePosition?: 'front' | 'back';
505
/** Background mute
506
* @supported weapp, tt, qq, jd
507
* @default false
508
*/
509
backgroundMute?: boolean;
510
/** Mirror mode
511
* @supported weapp, tt, qq, jd
512
* @default "auto"
513
*/
514
mirror?: 'auto' | 'enable' | 'disable';
515
/** State change callback */
516
onStateChange?: (event: LivePusherStateChangeEvent) => void;
517
/** Net status callback */
518
onNetStatus?: (event: LivePusherNetStatusEvent) => void;
519
/** Error callback */
520
onError?: (event: LivePusherErrorEvent) => void;
521
/** Background push callback */
522
onBgmStart?: (event: TaroEvent) => void;
523
/** Background music progress callback */
524
onBgmProgress?: (event: LivePusherBgmProgressEvent) => void;
525
/** Background music complete callback */
526
onBgmComplete?: (event: TaroEvent) => void;
527
/** Audio volume notify callback */
528
onAudioVolumeNotify?: (event: LivePusherAudioVolumeNotifyEvent) => void;
529
}
530
```
531
532
### Animation and Effects
533
534
Components for animated content and special effects.
535
536
```typescript { .api }
537
/**
538
* Lottie animation player
539
* @supported weapp, tt, qq, jd, h5, rn
540
*/
541
const Lottie: ComponentType<LottieProps>;
542
543
interface LottieProps extends StandardProps {
544
/** Animation source path or URL
545
* @supported weapp, tt, qq, jd, h5, rn
546
*/
547
path?: string;
548
/** Animation speed multiplier
549
* @supported weapp, tt, qq, jd, h5, rn
550
* @default 1
551
*/
552
speed?: number;
553
/** Whether animation is looped
554
* @supported weapp, tt, qq, jd, h5, rn
555
* @default true
556
*/
557
loop?: boolean;
558
/** Whether autoplay is enabled
559
* @supported weapp, tt, qq, jd, h5, rn
560
* @default true
561
*/
562
autoplay?: boolean;
563
/** Animation action
564
* @supported weapp, tt, qq, jd, h5, rn
565
* @default "play"
566
*/
567
action?: 'play' | 'pause' | 'stop';
568
/** Whether animation is hidden when stopped
569
* @supported weapp, tt, qq, jd, h5, rn
570
* @default true
571
*/
572
hidden?: boolean;
573
/** Animation data ready callback */
574
onDataReady?: (event: TaroEvent) => void;
575
/** Animation data load failed callback */
576
onDataFailed?: (event: TaroEvent) => void;
577
/** Animation data load callback */
578
onAnimationStart?: (event: TaroEvent) => void;
579
/** Animation end callback */
580
onAnimationEnd?: (event: TaroEvent) => void;
581
}
582
583
/**
584
* Animated video component
585
* @supported weapp, tt, qq, jd
586
*/
587
const AnimationVideo: ComponentType<AnimationVideoProps>;
588
589
interface AnimationVideoProps extends StandardProps {
590
/** Animation video source
591
* @supported weapp, tt, qq, jd
592
*/
593
src?: string;
594
/** Whether to loop animation
595
* @supported weapp, tt, qq, jd
596
* @default false
597
*/
598
loop?: boolean;
599
/** Whether autoplay is enabled
600
* @supported weapp, tt, qq, jd
601
* @default false
602
*/
603
autoplay?: boolean;
604
/** Animation action
605
* @supported weapp, tt, qq, jd
606
* @default "play"
607
*/
608
action?: 'play' | 'pause' | 'stop';
609
/** Whether animation is hidden when stopped
610
* @supported weapp, tt, qq, jd
611
* @default true
612
*/
613
hidden?: boolean;
614
}
615
```
616
617
### Additional Media Components
618
619
Extended media components for specialized video and communication features.
620
621
```typescript { .api }
622
/**
623
* AR camera component
624
* @supported weapp, tt, qq, jd
625
*/
626
const ArCamera: ComponentType<ArCameraProps>;
627
628
interface ArCameraProps extends StandardProps {
629
/** AR camera key
630
* @supported weapp, tt, qq, jd
631
*/
632
key?: string;
633
/** AR camera mode
634
* @supported weapp, tt, qq, jd
635
* @default "normal"
636
*/
637
mode?: 'normal' | 'AR';
638
/** AR camera ready callback */
639
onReady?: (event: TaroEvent) => void;
640
/** AR scan callback */
641
onScan?: (event: ArCameraScanEvent) => void;
642
/** AR camera error callback */
643
onError?: (event: ArCameraErrorEvent) => void;
644
}
645
646
/**
647
* Live channel component
648
* @supported weapp, tt, qq, jd
649
*/
650
const ChannelLive: ComponentType<ChannelLiveProps>;
651
652
interface ChannelLiveProps extends StandardProps {
653
/** Channel ID
654
* @supported weapp, tt, qq, jd
655
*/
656
channelId?: string;
657
/** Channel live load callback */
658
onLoad?: (event: ChannelLiveLoadEvent) => void;
659
/** Channel live error callback */
660
onError?: (event: ChannelLiveErrorEvent) => void;
661
}
662
663
/**
664
* Video channel component
665
* @supported weapp, tt, qq, jd
666
*/
667
const ChannelVideo: ComponentType<ChannelVideoProps>;
668
669
interface ChannelVideoProps extends StandardProps {
670
/** Channel video ID
671
* @supported weapp, tt, qq, jd
672
*/
673
videoId?: string;
674
/** Channel video load callback */
675
onLoad?: (event: ChannelVideoLoadEvent) => void;
676
/** Channel video error callback */
677
onError?: (event: ChannelVideoErrorEvent) => void;
678
}
679
680
/**
681
* VoIP room component
682
* @supported weapp, tt, qq, jd
683
*/
684
const VoipRoom: ComponentType<VoipRoomProps>;
685
686
interface VoipRoomProps extends StandardProps {
687
/** Room ID
688
* @supported weapp, tt, qq, jd
689
*/
690
roomId?: string;
691
/** Open type
692
* @supported weapp, tt, qq, jd
693
*/
694
openType?: 'voice' | 'video';
695
/** VoIP room join callback */
696
onJoin?: (event: VoipRoomJoinEvent) => void;
697
/** VoIP room leave callback */
698
onLeave?: (event: VoipRoomLeaveEvent) => void;
699
/** VoIP room error callback */
700
onError?: (event: VoipRoomErrorEvent) => void;
701
}
702
703
/**
704
* Real-time communication room
705
* @supported weapp, tt, qq, jd
706
*/
707
const RtcRoom: ComponentType<RtcRoomProps>;
708
709
interface RtcRoomProps extends StandardProps {
710
/** RTC room ID
711
* @supported weapp, tt, qq, jd
712
*/
713
roomId?: string;
714
/** RTC room join callback */
715
onJoin?: (event: RtcRoomJoinEvent) => void;
716
/** RTC room leave callback */
717
onLeave?: (event: RtcRoomLeaveEvent) => void;
718
/** RTC room error callback */
719
onError?: (event: RtcRoomErrorEvent) => void;
720
}
721
722
/**
723
* RTC room participant item
724
* @supported weapp, tt, qq, jd
725
*/
726
const RtcRoomItem: ComponentType<RtcRoomItemProps>;
727
728
interface RtcRoomItemProps extends StandardProps {
729
/** Participant user ID
730
* @supported weapp, tt, qq, jd
731
*/
732
userId?: string;
733
/** Stream type
734
* @supported weapp, tt, qq, jd
735
*/
736
streamType?: 'main' | 'aux';
737
}
738
```
739
740
## Types
741
742
```typescript { .api }
743
// AR Camera event interfaces
744
interface ArCameraScanEvent extends TaroEvent {
745
detail: {
746
result: string;
747
type: string;
748
};
749
}
750
751
interface ArCameraErrorEvent extends TaroEvent {
752
detail: {
753
errMsg: string;
754
};
755
}
756
757
// Channel event interfaces
758
interface ChannelLiveLoadEvent extends TaroEvent {
759
detail: {
760
// Channel live load details
761
};
762
}
763
764
interface ChannelLiveErrorEvent extends TaroEvent {
765
detail: {
766
errMsg: string;
767
};
768
}
769
770
interface ChannelVideoLoadEvent extends TaroEvent {
771
detail: {
772
// Channel video load details
773
};
774
}
775
776
interface ChannelVideoErrorEvent extends TaroEvent {
777
detail: {
778
errMsg: string;
779
};
780
}
781
782
// VoIP and RTC event interfaces
783
interface VoipRoomJoinEvent extends TaroEvent {
784
detail: {
785
// Join event details
786
};
787
}
788
789
interface VoipRoomLeaveEvent extends TaroEvent {
790
detail: {
791
// Leave event details
792
};
793
}
794
795
interface VoipRoomErrorEvent extends TaroEvent {
796
detail: {
797
errMsg: string;
798
};
799
}
800
801
interface RtcRoomJoinEvent extends TaroEvent {
802
detail: {
803
// RTC join event details
804
};
805
}
806
807
interface RtcRoomLeaveEvent extends TaroEvent {
808
detail: {
809
// RTC leave event details
810
};
811
}
812
813
interface RtcRoomErrorEvent extends TaroEvent {
814
detail: {
815
errMsg: string;
816
};
817
}
818
```
819
820
## Original Types
821
822
```typescript { .api }
823
// Image event interfaces
824
interface ImageLoadEvent extends TaroEvent {
825
detail: {
826
height: number;
827
width: number;
828
};
829
}
830
831
interface ImageErrorEvent extends TaroEvent {
832
detail: {
833
errMsg: string;
834
};
835
}
836
837
// Video event interfaces
838
interface VideoLoadedMetadataEvent extends TaroEvent {
839
detail: {
840
width: number;
841
height: number;
842
duration: number;
843
};
844
}
845
846
interface VideoTimeUpdateEvent extends TaroEvent {
847
detail: {
848
currentTime: number;
849
duration: number;
850
};
851
}
852
853
interface VideoFullscreenChangeEvent extends TaroEvent {
854
detail: {
855
fullScreen: boolean;
856
direction: 'vertical' | 'horizontal';
857
};
858
}
859
860
interface VideoErrorEvent extends TaroEvent {
861
detail: {
862
errMsg: string;
863
};
864
}
865
866
interface VideoProgressEvent extends TaroEvent {
867
detail: {
868
buffered: number;
869
};
870
}
871
872
// Audio event interfaces
873
interface AudioErrorEvent extends TaroEvent {
874
detail: {
875
errMsg: string;
876
};
877
}
878
879
interface AudioTimeUpdateEvent extends TaroEvent {
880
detail: {
881
currentTime: number;
882
duration: number;
883
};
884
}
885
886
// Camera event interfaces
887
interface CameraErrorEvent extends TaroEvent {
888
detail: {
889
errMsg: string;
890
};
891
}
892
893
interface CameraScanCodeEvent extends TaroEvent {
894
detail: {
895
result: string;
896
};
897
}
898
899
// Live streaming event interfaces
900
interface LivePlayerStateChangeEvent extends TaroEvent {
901
detail: {
902
code: number;
903
};
904
}
905
906
interface LivePlayerFullScreenChangeEvent extends TaroEvent {
907
detail: {
908
direction: 'vertical' | 'horizontal';
909
fullScreen: boolean;
910
};
911
}
912
913
interface LivePlayerNetStatusEvent extends TaroEvent {
914
detail: {
915
info: Record<string, any>;
916
};
917
}
918
919
interface LivePlayerAudioVolumeNotifyEvent extends TaroEvent {
920
detail: {
921
volume: number;
922
};
923
}
924
925
interface LivePusherStateChangeEvent extends TaroEvent {
926
detail: {
927
code: number;
928
};
929
}
930
931
interface LivePusherNetStatusEvent extends TaroEvent {
932
detail: {
933
info: Record<string, any>;
934
};
935
}
936
937
interface LivePusherErrorEvent extends TaroEvent {
938
detail: {
939
errMsg: string;
940
errCode: number;
941
};
942
}
943
944
interface LivePusherBgmProgressEvent extends TaroEvent {
945
detail: {
946
progress: number;
947
duration: number;
948
};
949
}
950
951
interface LivePusherAudioVolumeNotifyEvent extends TaroEvent {
952
detail: {
953
volume: number;
954
};
955
}
956
```