Types
NOTE
The initial APIs of this module are supported since API version 9. Updates will be marked with a superscript to indicate their earliest API version.
The sample effect is subject to the actual device.
WebMessage
type WebMessage = ArrayBuffer|string
Defines the data types supported by WebMessagePort.
System capability: SystemCapability.Web.Webview.Core
| Type | Description |
|---|---|
| string | String type. |
| ArrayBuffer | Binary type. |
OnProxyConfigChangeCallback15+
type OnProxyConfigChangeCallback = () => void
Defines a callback triggered when the proxy is set successfully.
System capability: SystemCapability.Web.Webview.Core
Example
For details about the sample code, see removeProxyOverride.
CreateNativeMediaPlayerCallback12+
type CreateNativeMediaPlayerCallback = (handler: NativeMediaPlayerHandler, mediaInfo: MediaInfo) => NativeMediaPlayerBridge
Defines a CreateNativeMediaPlayerCallback object used as a parameter of the onCreateNativeMediaPlayer callback. This object is used to create a player to take over media playback of the web page.
System capability: SystemCapability.Web.Webview.Core
Parameters
| Name | Type | Mandatory | Description |
|---|---|---|---|
| handler | NativeMediaPlayerHandler | Yes | Object used to report the player status to the ArkWeb engine. |
| mediaInfo | MediaInfo | Yes | Information about the media on the web page. |
Return value
| Type | Description |
|---|---|
| NativeMediaPlayerBridge | Instance of the interface class between the player that takes over web media and the ArkWeb kernel. The application needs to implement this interface class. The ArkWeb engine uses an object of this interface class to control the player created by the application to take over web page media. If the application returns null, the application does not take over the media playback, and the media will be played by the ArkWeb engine. |
Example
For details about the sample code, see onCreateNativeMediaPlayer.
你可能感兴趣的鸿蒙文章
openharmony 鸿蒙 arkts-apis-webview-WebviewController
openharmony 鸿蒙 arkts-apis-webview
openharmony 鸿蒙 capi-arkweb-type-h
openharmony 鸿蒙 arkts-basic-components-web-FullScreenExitHandler
openharmony 鸿蒙 arkts-apis-webview-WebDownloadManager
openharmony 鸿蒙 arkts-basic-components-web-VerifyPinHandler
openharmony 鸿蒙 capi-web-arkweb-webmessage8h
openharmony 鸿蒙 arkts-apis-webview-NativeMediaPlayerHandler