refactor: Update VAST plugin in Artplayer

This commit is contained in:
Harvey Zack committed 2024-08-23 23:23:50 +08:00
1 parent f9192ff852
commit 87b0506f51
5 files changed
+32 -17

No files matched your search

+9 -2
View File
@@ -1,3 +1,7 @@
// Depends on:
// https://glomex.github.io/vast-ima-player/
// https://developers.google.com/interactive-media-ads/docs/sdks/html5/client-side
// npm i artplayer-plugin-vast
// import artplayerPluginVast from 'artplayer-plugin-vast';
@@ -7,8 +11,11 @@ var art = new Artplayer({
fullscreen: true,
fullscreenWeb: true,
plugins: [
artplayerPluginVast(({ playUrl }) => {
//
artplayerPluginVast(({ playUrl, imaPlayer, ima }) => {
// Play the ad when the video is played
art.once('play', () => {
playUrl('https://artplayer.org/assets/vast/linear-ad.xml');
});
}),
],
});