openharmony 鸿蒙 arkts-apis-webview-t

2026-08-25 浏览 (1)

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

TypeDescription
stringString type.
ArrayBufferBinary 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

NameTypeMandatoryDescription
handlerNativeMediaPlayerHandlerYesObject used to report the player status to the ArkWeb engine.
mediaInfoMediaInfoYesInformation about the media on the web page.

Return value

TypeDescription
NativeMediaPlayerBridgeInstance 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

openharmony 鸿蒙 capi-web-arkweb-proxymethodwithresult

openharmony 鸿蒙 arkts-basic-components-web-WebResourceError

  • 所属分类: 后端技术
  • 本文标签: 鸿蒙 软件
  • 版权声明: 本文链接 https://seaxiang.com/blog/TRONI6Qx