Skip to content

Media Components

Media Components introductions

componentIntroductionsMinimum versionRemark
audioaudio1.0.0
imageimage1.0.0
videovideo1.0.0
cameracamera2.9.3
live-playerlive-player2.10.1Requires a third-party audio/video SDK
live-pusherlive-pusher2.10.1Requires a third-party audio/video SDK
voip-roomvoip-roomNot supported

audio

attributetypeDefault valueRequiredIntroductionsMinimum version
idstringnoaudio Unique identifier for a component1.0.0
srcstringnoResource address to play audio1.0.0
loopbooleanfalsenoWhether to play on a loop1.0.0
controlsbooleanfalsenoWhether to play on a loop1.0.0
posterstringnoThe image resource address of the audio cover on the default control, if controls Attribute value is false Setting poster invalid1.0.0
namestringUnknown audionoThe audio name on the default control, if controls Attribute value is false Setting name invalid1.0.0
authorstringUnknown authornoAuthor name on the default control, if controls Attribute value is false Setting author invalid1.0.0
binderroreventhandlenoTriggered when an error occurs error Event, detail = {errMsg:MediaError.code}1.0.0
bindplayeventhandlenoWhen it starts/Triggers play event while continuing playback1.0.0
bindpauseeventhandlenoWhen it starts/Triggers play event while continuing playback1.0.0
bindtimeupdateeventhandlenoTriggered when playback progress changes timeupdate Event, detail = {currentTime, duration}1.0.0
bindendedeventhandlenoTrigger when playback ends ended event1.0.0

image

attributetypeDefault valueRequiredIntroductionsMinimum version
srcstringnoPhoto Resource Address2.11.4
modestringscaleToFillnoImage Cropping, Zooming Mode2.11.4
binderroreventhandlenoTriggered when an error occurs, event.detail = {errMsg}2.11.4
bindloadeventhandlenoTriggered when the image is loaded, event.detail = {height, width}2.11.4
webpbooleanfalsenoDefault does not resolve webP Format, support network resources onlyNot supported
lazy-loadbooleanfalsenoPicture lazy loading, in about to enter a certain range (up and down three screens) before starting to load2.12.2
show-menu-by-longpressbooleanfalsenoLong press picture display send to friends, collection, save pictures, search a search, open business card/Go to the group chat/Open the phizclip menu (if the picture contains the corresponding two-dimensional code or phizclip code)Not supported
ValueIntroductionsMinimum version
scaleToFillZoom mode, zoom the picture without maintaining aspect ratio, so that the width of the picture is fully stretched to fill image element
aspectFitZoom mode, zoom the picture without maintaining aspect ratio, so that the width of the picture is fully stretched to fill image element
aspectFillZoom mode, keep the aspect ratio zoom picture, only to ensure that the short side of the picture can be fully displayed. That is, the picture is usually only complete in the horizontal or vertical direction, the other direction will be taken.
widthFixZoom mode, width unchanged, height automatically changed, keep the original width to height ratio unchanged
heightFixZoom mode, height unchanged, width automatically changed, keep the original width to height ratio unchanged
topZoom mode, height unchanged, width automatically changed, keep the original width to height ratio unchanged
bottomCrop mode, does not scale the picture, shows only the bottom area of the picture
centerCropping mode, does not scale the picture, only shows the middle area of the picture
leftCrop mode, does not scale the picture, only shows the left area of the picture
rightCropping mode, does not scale the picture, only shows the right area of the picture
top leftCropping mode, does not scale the picture, only shows the right area of the picture
top rightCrop mode, does not scale the picture, only shows the top right area of the picture
bottom leftCropping mode, does not scale the picture, only shows the lower left area of the picture
bottom rightCropping mode, does not scale the picture, only shows the lower right area of the picture

live-player

Attention please

live-playerIs PhizClip withSound net to use this component, you need to integrate PhizClip small program SDK and sound network SDK in the App before using it.

attributetypeDefault valueRequiredIntroductionsMinimum version
srcstringnoAudio and video address. Currently supports only flv, rtmp format1.7.0
modestringlivenoPattern1.7.0
autoplaybooleanfalsenoAuto play1.7.0
mutedbooleanfalsenoIs it muted?1.7.0
orientationstringverticalnoPicture direction1.7.0
object-fitstringcontainnoFill mode, optional contain,fillCrop1.7.0
background-mutebooleanfalsenoIs it muted when entering the background? (Deprecated, Mute by default)1.7.0
min-cachenumber1noMinimum buffer in s (RTC Model recommendation 0.2s)1.7.0
max-cachenumber3noMaximum buffer in s (RTC Model recommendation 0.8s)。 Buffer is used to resist network fluctuation. The more buffer data, the better network resistance, but the greater the delay.1.7.0
sound-modestringspeakernoSound output mode1.9.90
auto-pause-if-navigatebooleantruenoSound output mode2.5.0
auto-pause-if-open-nativebooleantruenoWhen jump to other Phiz original page, whether to automatically suspend the page of real-time audio and video playback2.5.0
picture-in-picture-modestring/ArraynoSet the window mode: push, Pop, empty string, or set multiple modes as an array such as ["push", "pop"])2.10.3
bindstatechangeeventhandlenoPlay state change event, detail = {code}1.7.0
bindfullscreenchangeeventhandlenoFull screen change event, detail = {direction, fullScreen}1.7.0
bindnetstatuseventhandlenoNetwork status notification, detail = {info}1.9.0
bindaudiovolumenotifyeventhandlernoPlay volume size notification, detail = {}2.10.0
bindenterpictureinpictureeventhandlernoPlayer into the small window2.11.0
bindleavepictureinpictureeventhandlernoPlayer exit window2.11.0
valueIntroductionsMinimum version
livelive broadcast
RTCReal time calls, lower latency in this mode
valueIntroductionsMinimum version
verticalvertical
horizontalvertical
valueIntroductionsMinimum version
containThe long side of the image fills the screen, the short side area will be filled
fillCropImage spread across the screen, beyond the display area will be cut of
valueIntroductionsMinimum version
speakerspeaker
earReceiver
valueIntroductionsMinimum version
[]Cancel the small window
pushrouting push Trigger window
poprouting pop Trigger window

Status code

codeIntroductions
2001Connected to server
2002Already connected RTMP Server, start pulling the flow.
2003Network receives first video packet(IDR)
2004Video playback begins
2005Video Playback Progress
2006End of video playback
2007Video Playback Loading
2008Decoder startup
2009Video resolution changes
-2301Network disconnection, and after repeated connection rescue invalid, more retry please restart play
-2302Failed to get an accelerated pull-down address
2101Current video frame decoding failed
2102Current audio frame decoding failure
2103Current audio frame decoding failure
2104Network to packet instability: May be insufficient downlink bandwidth or because the anchor end streaming uneven
2105Current video playback appears to be Caton
2106Hard solution failed to start, soft solution
2107Hard solution failed to start, soft solution
2108Current stream hard solution first I frame failed, SDK automatically cut soft solution
3001RTMP - DNS resolution failure
3002RTMP server connection failed
3003RTMP server handshake failure
3005RTMP read/Write failed, then a network retry is initiated

Network status data

Key nameIntroductions
videoBitrateCurrent Video Coding/Bit rate of encoder output, unit kbps
audioBitrateCurrent Video Coding/Bit rate of encoder output, unit kbps
videoFPSCurrent Video Frame Rate
videoGOPCurrent Video GOP, which is every two keyframes(I frame) interval duration, in units s
netSpeedCurrent Send/Receiving speed
netJitterNetwork jitter; otherwise 0 When there is no jitter, the larger the value indicates that the greater the network jitters, the more unstable the network is
netQualityLevelNetwork quality: 0: undefined 1: Best 2: Good 3: General 4: Poor 5: Poor 6: Not available
videoWidthWidth of video frame
videoHeightWidth of video frame
videoCacheTotal length of cached video in milliseconds
audioCacheTotal length of cached video in milliseconds
vDecCacheSizeNumber of video frames cached in the decoder (Android Exists when the end hard decodes)
vSumCacheSizeThe total number of video frames buffered, the greater the number, the higher the playback delay
avPlayIntervalAudio Picture Synchronization Offset Time (Playback), Unit Ms, the smaller this value, the better the sound and picture synchronization
avRecvIntervalAudio Picture Synchronization Offset Time (Playback), Unit Ms, the smaller this value, the better the sound and picture synchronization
audioCacheThresholdAudio buffer duration threshold, buffer exceeds this threshold, the player will start to adjust the delay

live-pusher

Attention please

live-pusher is the function of PhizClip andsound networkTo use this component, you need to integrate PhizClip applet SDK and sound network SDK in the App before using it.

attributetypeDefault valueRequiredIntroductionsMinimum version
urlstringnoPush stream address. Currently supports only rtmp format1.7.0
modestringRTCnoSD(SD), HD(HD), FHD(Ultra clear), RTC(Live Call)1.7.0
autopushbooleanfalsenoAutomatic pusher1.7.0
mutedbooleanfalsenoWhether or not to mute. Soon to be abandoned and available enable-mic Replace1.7.0
enable-camerabooleantruenoTurn on the camera.1.7.0
auto-focusbooleantruenoAutomatic aggregation1.7.0
orientationstringverticalnoAutomatic aggregation1.7.0
beautynumber0noBeauty, value range 0-9 ,0 Indicate closure1.7.0
whitenessnumber0noWhitening, value range 0-9 ,0 Indicate closure1.7.0
aspectstring9:16noAspect ratio, optional 3:4, 9:161.7.0
min-bitratenumber200noMinimum bitrate1.7.0
max-bitratenumber1000noMaximum bitrate1.7.0
audio-qualitystringhighnoHigh quality(48 KHz) or low sound quality(16 KHz), with a value ofhigh, low1.7.0
waiting-imagestringnoA waiting screen for the stream as it enters the background1.7.0
waiting-image-hashstringnoMD5 Value of Wait Screen Resource1.7.0
zoombooleanfalsenoAdjust focus2.1.0
device-positionstringfrontnoBefore or after, with a value offront, back2.3.0
background-mutebooleanfalsenoIs it muted when entering the background? (Deprecated, Mute by default)1.7.0
mirrorbooleanfalsenoSet whether the pushstream image is mirrored, and the effect is live-player React to2.7.0
remote-mirrorbooleanfalsenowith mirror Attribute, Follow mirror Will be abandoned2.10.0
local-mirrorstringautonoControl whether the local preview screen is mirrored2.10.0
audio-reverb-typenumber0noAudio reverberation type2.10.0
enable-micbooleantruenoAudio reverberation type2.10.0
enable-agcbooleanfalsenoWhether audio auto gain is on.2.10.0
enable-ansbooleanfalsenoTurn on audio noise suppression2.10.0
audio-volume-typestringautonoVolume type2.10.0
video-widthnumber360noVolume type2.10.0
video-heightnumber640noResolution height of the upshot video stream2.10.0
beauty-stylestringsmoothnoSet Beauty Type2.12.0
filterstringstandardnoSet the color filter2.12.0
bindstatechangeeventhandlenoState change event, detail = {code}1.7.0
bindnetstatuseventhandlenoNetwork status notification, detail = {info}1.9.0
binderroreventhandlenoRender error events, detail = {errMsg, errCode}1.7.4
bindbgmstarteventhandlenoTriggered when background sound starts playing2.4.0
bindbgmprogresseventhandlenoTriggered when background sound progress changes, detail = {progress, duration}2.4.0
bindbgmcompleteeventhandlenoTriggered when background sound is finished2.4.0
bindaudiovolumenotifyeventhandlenoReturns the volume collected by the microphone2.12.0
valueIntroductionsMinimum version
verticalvertical
horizontallevel
valueIntroductionsMinimum version
autoFront camera mirror, rear camera not mirror
enableFront and rear cameras are mirrored
disableFront and rear cameras are not mirrored
valueIntroductionsMinimum version
0Stop
1KTV
2Cubby
3General Assembly Hall
4Low
5Resonant
6Metallic sound
7magnetic
valueIntroductionsMinimum version
autoautomatic
mediaMedia Volume
voicecallCall volume
valueIntroductionsMinimum version
smoothSmooth beauty
natureNatural beauty
valueIntroductionsMinimum version
standardstandard
pinkPink and tender
nostalgiaNostalgia
bluesblues
romanticromantic
coolCool and refreshing
fresherfresh
solorJapanese section
aestheticismaesthetics
whiteningto whiten
ceriseredFuchsia

video

attributetypeDefault valueRequiredIntroductionsMinimum version
srcstringyesResource address to play video, support network path, local temporary path, cloud file ID (2.3.0)1.0.0
durationnumbernoSpecify video length1.1.0
controlsbooleantruenoWhether to display the default playback controls/Pause on, playback progress, time)1.0.0
danmu-listArray.<object>noBarrage list1.0.0
danmu-btnbooleanfalsenoWhether to display barrage on, only valid at initialization time, can not be dynamically changed1.0.0
enable-danmubooleanfalsenoWhether to show barrage, only valid at initialization time, can't change dynamically1.0.0
autoplaybooleanfalsenoWhether to autoplay1.0.0
loopbooleanfalsenoWhether to play on a loop2.11.2
mutedbooleanfalsenoMute Play2.11.2
initial-timenumber0noSpecify initial video playback location2.11.2
directionnumbernoSet the direction of the video at full screen. If not specified, it will be automatically judged according to the aspect ratio2.11.2
show-progressbooleantruenoIf not set, the width is greater than 240 will be displayed2.11.2
show-fullscreen-btnbooleantruenoWhether to display full screen ons2.11.2
show-play-btnbooleantruenoWhether to display the Play on on the bottom of the video control bar2.11.2
show-center-play-btnbooleantruenoWhether to display the play on in the middle of the video2.11.2
enable-progress-gesturebooleantruenoWhether to turn on the control of progress gestures2.11.2
object-fitstringcontainnoWhen the video size is video Video representation when container sizes are inconsistent1.0.0
posterstringnoVideo Cover Picture Network Resource Address or Cloud File ID (2.3.0)。 if controls Attribute value is false Setting poster invalid1.0.0
show-mute-btnbooleanfalsenoWhether to display mute on2.11.2
titlestringnoVideo caption, shown at the top when full screen2.11.2
play-btn-positionstringbottomnoPosition of play on2.11.2
enable-play-gesturebooleanfalsenoWhether to turn on play gesture, that is, double-click toggle play/Pause2.11.2
auto-pause-if-navigatebooleantruenoWhen jump to other pages of this phizclip, whether to automatically pause the page of video playback2.11.2
auto-pause-if-open-nativebooleantruenoWhen jump to other Phiz original page, whether to automatically suspend the page of the video2.11.2(Android only)
vslide-gesturebooleanfalsenoWhether to turn on the brightness and volume gestures in non-fullscreen mode page-gesture)2.11.2
vslide-gesture-in-fullscreenbooleantruenoWhether to turn on brightness and volume adjustment gestures in full screen mode2.11.2
poster-for-crawlerstringyesFor search and other scenes as a video cover display, recommended to use no play icon Video cover image, support network address onlyNot supported
show-casting-buttonbooleanfalsenoDisplay the screen shot on. Android works with same render, support DLNA agreementiOS Support AirPlay and DLNA agreement3.0.31
picture-in-picture-modestring/ArraynoSet the window mode: push, Pop, empty string, or set multiple modes as an array such as ["push", "pop"])3.0.31
picture-in-picture-show-progressbooleanfalsenoWhether to display playback progress in small window mode3.0.31
enable-auto-rotationbooleanfalsenoWhether to turn on the mobile phone horizontal screen automatically full screen, when the system settings turn on automatic rotation2.11.2
show-screen-lock-buttonbooleanfalsenoWhether to display the lock screen on, only in full screen display, lock screen after the control bar operation2.11.2
show-snapshot-buttonbooleanfalsenoWhether to display the screenshot on, only in full screen2.11.2
show-background-playback-buttonbooleanfalsenoWhether to display the screenshot on, only in full screen2.11.2
background-posterstringnoNotification bar icon after background audio playback (Android Exclusive)2.11.2(Android only)
bindplayeventhandlenoWhen it starts/Triggers play event while continuing playback1.0.0
bindpauseeventhandlenoTriggered when playback is paused pause event1.0.0
bindendedeventhandlenoTrigger when playback ends ended event1.0.0
bindtimeupdateeventhandlenoTrigger when playback ends ended event1.0.0
bindfullscreenchangeeventhandlenoTrigger when playback ends ended event1.0.0
bindwaitingeventhandlenoTriggered when video buffer appears2.11.2
binderroreventhandlenoTriggered when video playback goes wrong2.11.2
bindprogresseventhandlenoTriggered when load schedule changes, only one load is supported. event.detail = {buffered}, percentage2.11.2
bindloadedmetadataeventhandlenoTriggered when video metadata is loaded. event.detail = {width, height, duration}2.11.2
bindcontrolstoggleeventhandlenoto switch over controls Triggered when show hidden. event.detail = {show}2.11.2
bindseekcompleteeventhandlernoPlayer into the small window2.11.2
bindenterpictureinpictureeventhandlernoPlayer exit windowNot supported
bindleavepictureinpictureeventhandlernoseek Completion Trigger (position iOS unit s, Android unit ms)Not supported

Note:

  • 2.11.2 The basic library must be used with SDK 2.34.1
  • Some IDE properties do not support setting, mainly involving full screen, gesture, painting in painting mode and other properties, it is recommended to use a real machine to view

native-view

Native view containers

attributetypeDefault valueRequiredIntroductionsMinimum version
typestringcamerayesNative container type, setting will only be unchangeable
optionsstring{}noCustom parameters passed to the native component, using json data string formatted results
bindontaskeventhandlenoReceive events sent by native components

Sample code

javascript
<native-view
  type="{{type}}"
  options="{{options}}"
  bindready="bindonready"
></native-view>

Note: To listen to native view events globally, refer to the onCustomEvent API

camera

attributetypeDefault valueRequiredIntroductionsMinimum version
modestringnormalnoApplication mode, valid only at initialization time, not dynamically changing2.11.4
resolutionstringmediumnoResolution, does not support dynamic modification2.11.4
device-positionstringbacknoCamera facing2.11.4
flashstringautonoFlash, value auto, on, off2.11.4
frame-sizestringmediumnoSpecify the desired camera frame data size2.11.4
bindstopeventhandlenoThe camera is triggered when it terminates abnormally, such as when it exits the background.2.11.4
binderroreventhandlenoTriggered when the user is not allowed to use the cameraNot supported
bindinitdoneeventhandlenoTriggered when the camera initialization is complete, event.detail = {maxZoom}2.11.4
bindscancodeeventhandlenoTriggered when the scan is successful, only after mode="scanCode" Effective2.11.4