Links
Comment on page

Media Player

Custom Media Player AdOn Controls
You'll need to import the javascript file in your website before starting from this link.
Functions required to have a media player like notification and control it in Android devices.

Start Media

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.

Pause Media

Plain JS
ES 6+
window.WTN.MediaPlayer.pauseMedia();
import MediaPlayer from "webtonative/MediaPlayer";
MediaPlayer.pauseMedia();

Stop Media

Plain JS
ES 6+
window.WTN.MediaPlayer.stopMedia();
import MediaPlayer from "webtonative/MediaPlayer";
MediaPlayer.stopMedia();
*Feature was taken live on 26/09/2023