Comment on page
Media Player
Custom Media Player AdOn Controls
Functions required to have a media player like notification and control it in Android devices.
To start the media with controls call the function.
Plain JS
ES 6+
window.WTN.MediaPlayer.playMedia({
url:"Your Media URL",
image:"Custom Image that should be shown in the notifcation"
})
import MediaPlayer from "webtonative/MediaPlayer";
MediaPlayer.playMedia({
url:"Your Media URL",
image:"Custom Image that should be shown in the notifcation"
})
image (optional) : It's an optional parameter to show the image in notification else default image will be shown.
Plain JS
ES 6+
window.WTN.MediaPlayer.pauseMedia();
import MediaPlayer from "webtonative/MediaPlayer";
MediaPlayer.pauseMedia();
Plain JS
ES 6+
window.WTN.MediaPlayer.stopMedia();
import MediaPlayer from "webtonative/MediaPlayer";
MediaPlayer.stopMedia();
*Feature was taken live on 26/09/2023
Last modified 1mo ago