Created
March 29, 2022 14:22
-
-
Save senaev/7b7c5da7a350b2d2e72d1130002d3ad5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| await ya.videoAd.loadModule('AdLoader').then(function (module) { | |
| return module.AdLoader.create({ | |
| adFoxParameters: { | |
| ownerId: '277740', | |
| params: { | |
| p1: 'cruwm', | |
| p2: 'gdol' | |
| } | |
| }, | |
| wrapperTimeout: 6e3, | |
| vastTimeout: 3e3, | |
| adBreakType: 'preroll' | |
| }); | |
| }).then(function (adLoader) { | |
| return new Promise(resolve => { | |
| return resolve(adLoader.loadAd()); | |
| }); | |
| }).then(function (adStore) { | |
| const adPlaybackController = adStore.createPlaybackController(videoSlot.current, controlsSlot.current); | |
| adPlaybackController.subscribe('AdStopped', function () { | |
| dispatch(Object(redux_Player_PlayerAction__WEBPACK_IMPORTED_MODULE_3__["setAdStart"])(false)); | |
| }); | |
| adPlaybackController.playAd(); | |
| }).catch(function (error) { | |
| console.error(error === null || error === void 0 ? void 0 : error.code, '||| Player error code |||'); | |
| console.error(error === null || error === void 0 ? void 0 : error.details, '||| Player error details |||'); | |
| console.error(error, '||| Player error |||'); | |
| dispatch(Object(redux_Player_PlayerAction__WEBPACK_IMPORTED_MODULE_3__["setAdStart"])(false)); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment