Event Listeners
ParOne emits events based on user interactions. These will allow you to respond to those interactions in your application. These events are also available on the ParOne video tag itself.
Event | Notes |
---|---|
enterFullscreen | Emitted when a user enters fullscreen |
exitFullscreen | Emitted when a user exits fullscreen |
videoEnded | Emitted when a video ends |
WebView Events
ParOne emits events based on user interactions. These will allow you to respond to those interactions in your native application. These events are also available on the ParOne video tag itself.
Event | Notes |
---|---|
enterFullscreen | Emitted when a user enters fullscreen |
exitFullscreen | Emitted when a user exits fullscreen |
10second | Emitted once for every 10 seconds that a user watches of the video |
25percent | Emitted when a user has seen 25% of a video |
75percent | Emitted when a user has seen 75% of a video |
Controlling the player inside a WebView
To control the player in the WebView from native code, you can use our global handlers via webView.evaluateJavaScript()
on both Android and iOS. You will need to add some JS to the WebView to hold a reference to our element on the page, as seen in External Control. You can then wrap the calls to play()
and pause()
in a function that is called via webView.evaluateJavaScript('your_custom_play_wrapper()')
.
Apple iOS
Below is example code for detecting these events. You will want to copy this in the existing component definition.
For additional information see Messaging between WKWebView and Swift | (GitHUB)
Android
Below is example code for detecting these events. You will want to copy this in the existing component definition.
For additional information see Messaging between WebView and Android.
Flutter
In Flutter, you must create a JavaScript channel with the name 'ParOneChannel'
to receive messages. To send data, you can use the same methodology as for Swift/Kotlin.