title: LivePlayerContext
sidebar_label: LivePlayerContext
The LivePlayerContext
instance can be obtained with Taro.createLivePlayerContext
.
LivePlayerContext
is bound to an live-player
component with an id, to work with the live-player
component.
Reference
Methods
exitFullScreen
Exits the full screen
Reference
(option?: ExitFullScreenOption) => void
Property |
Type |
option |
ExitFullScreenOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.exitFullScreen |
✔️ |
|
mute
Mute
Reference
(option?: MuteOption) => void
Property |
Type |
option |
MuteOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.mute |
✔️ |
|
pause
Pause
Reference
(option?: PauseOption) => void
Property |
Type |
option |
PauseOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.pause |
✔️ |
|
play
Plays an audio file.
Reference
(option?: PlayOption) => void
Property |
Type |
option |
PlayOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.play |
✔️ |
|
requestFullScreen
Enters the full screen.
Reference
(option: RequestFullScreenOption) => void
Property |
Type |
option |
RequestFullScreenOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.requestFullScreen |
✔️ |
|
resume
Redoes the operation.
Reference
(option?: ResumeOption) => void
Property |
Type |
option |
ResumeOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.resume |
✔️ |
|
snapshot
Screenshot
Reference
(option?: SnapshotOption) => void
Property |
Type |
option |
SnapshotOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.snapshot |
✔️ |
|
stop
Stop
Reference
(option?: StopOption) => void
Property |
Type |
option |
StopOption |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.stop |
✔️ |
|
Parameters
ExitFullScreenOption
Property |
Type |
Required |
Description |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
MuteOption
Property |
Type |
Required |
Description |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
PauseOption
Property |
Type |
Required |
Description |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
PlayOption
Property |
Type |
Required |
Description |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
RequestFullScreenOption
Property |
Type |
Required |
Description |
direction |
0 | 90 | -90 |
No |
Specifies the direction in the full screen |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
ResumeOption
Property |
Type |
Required |
Description |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
SnapshotOption
Property |
Type |
Required |
Description |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
SnapshotSuccessCallbackResult
Property |
Type |
Description |
height |
string |
The height of an image |
tempImagePath |
string |
Temporary path to images files |
width |
string |
The width of an image |
errMsg |
string |
Call result |
StopOption
Property |
Type |
Required |
Description |
complete |
(res: any) => void |
No |
The callback function used when the API call completed (always executed whether the call succeeds or fails) |
fail |
(res: any) => void |
No |
The callback function for a failed API call |
success |
(res: Result) => void |
No |
The callback function for a successful API call |
API Support
API |
WeChat Mini-Program |
H5 |
React Native |
LivePlayerContext.exitFullScreen |
✔️ |
|
|
LivePlayerContext.mute |
✔️ |
|
|
LivePlayerContext.pause |
✔️ |
|
|
LivePlayerContext.play |
✔️ |
|
|
LivePlayerContext.requestFullScreen |
✔️ |
|
|
LivePlayerContext.resume |
✔️ |
|
|
LivePlayerContext.snapshot |
✔️ |
|
|
LivePlayerContext.stop |
✔️ |
|
|