--- name: Media Components description: Image, video, audio, and camera components --- # Media Components ## image Display images with various mode options. ```vue ``` **Properties:** | Property | Type | Default | Description | |----------|------|---------|-------------| | src | String | | Image source URL | | mode | String | scaleToFill | Display mode (see below) | | lazy-load | Boolean | false | Lazy load image | | show-menu-by-longpress | Boolean | false | Show menu on long press | | webp | Boolean | false | Parse WebP format (Android) | **Mode Values:** | Mode | Description | |------|-------------| | scaleToFill | Fill container, may distort | | aspectFit | Contain within container | | aspectFill | Cover container, may clip | | widthFix | Width fixed, height auto | | heightFix | Height fixed, width auto | | top / bottom / center / left / right | Align to position | | top left / top right / bottom left / bottom right | Corner alignment | **Events:** - `@load` - Image loaded successfully - `@error` - Image failed to load ## video Video player component. ```vue ``` **Properties:** | Property | Type | Default | Description | |----------|------|---------|-------------| | src | String | | Video source URL | | controls | Boolean | true | Show controls | | autoplay | Boolean | false | Auto play | | loop | Boolean | false | Loop playback | | muted | Boolean | false | Muted | | initial-time | Number | 0 | Start time (s) | | duration | Number | | Total duration (s) | | poster | String | | Poster image URL | | object-fit | String | contain | contain/cover/fill | | danmu-list | Array | | Danmu list | | danmu-btn | Boolean | false | Show danmu button | | enable-danmu | Boolean | false | Enable danmu | | show-center-play-btn | Boolean | true | Show center play button | | show-play-btn | Boolean | true | Show play button | | show-fullscreen-btn | Boolean | true | Show fullscreen button | | page-gesture | Boolean | false | Enable page gesture | | enable-progress-gesture | Boolean | true | Enable progress gesture | ## audio Audio player (deprecated, use `uni.getBackgroundAudioManager` instead). ```vue ``` ## camera Camera component for capturing photos/videos. ```vue ``` **Properties:** | Property | Type | Default | Description | |----------|------|---------|-------------| | mode | String | normal | normal/scanCode | | resolution | String | medium | low/medium/high | | device-position | String | back | front/back | | flash | String | auto | auto/on/off | | frame-size | String | large | small/medium/large | ## live-player / live-pusher Live streaming components (mini-program only). ```vue ``` ## map Map component for displaying maps and markers. ```vue ```