Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

WeChat Small Program API Live Audio video LivePlayerContext instance


May 18, 2021 WeChat Mini Program Development Document


Table of contents


LivePlayerContext

LivePlayerContext instance, available at wx.createLivePlayerContext.

LivePlayerContext binds to a live-player component via id, which operates the corresponding live-player component.



Method:

LivePlayerContext.exitFullScreen(Object object)

Exit full screen

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)


LivePlayerContext.exitPictureInPicture(Object object)

Exit the window, which can be called on any page

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)


LivePlayerContext.mute(Object object)

Mute

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)


LivePlayerContext.pause(Object object)

Base library 1.9.90 starts to support, and low versions need to be compatible.

Time out

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)


LivePlayerContext.play(Object object)

Play

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)


LivePlayerContext.requestFullScreen(Object object)

Go to full screen

Parameters

Object object

Property Type The default Required Description
direction number 0 Whether Set the orientation when the full screen is set
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)

The legal value of object.direction

Value Description The lowest version
0 Normal vertical
90 The screen is 90 degrees counterclockwise
-90 The screen is clockwise 90 degrees


LivePlayerContext.resume(Object object)

Base library 1.9.90 starts to support, and low versions need to be compatible.

Recovery

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)


LivePlayerContext.snapshot(string quality)

Base Library 2.7.1 starts to support, and low versions need to be compatible.

Screenshots

Parameters

string quality

Base library 2.10.0 starts to support, and low versions need to be compatible.

The quality of the picture, the default original image. The valid values are raw and compressed


LivePlayerContext.stop(Object object)

Stop it

Parameters

Object object

Property Type The default Required Description
success function Whether The interface calls a successful callback function
fail function Whether The interface calls the failed callback function
complete function Whether Callback function at end of interface call (call succeeds, fails are executed)