Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function ovguide_app(external_params)
- app = {}
- app.deep_linking_data = external_params
- app.ads = ads()
- app.init = showChannelSGScreen
- return app
- end function
- 'Main function loop I do:
- m.ads.set_video_content(video_player.content)
- curent_position = video_player.position
- if curent_position <> invalid and curent_position > 0
- video_ads_to_play = m.ads.ads_to_play(curent_position)
- if video_ads_to_play <> invalid
- video_player.control = "stop"
- ' For whatever reason, the ad player begins to send position to the video player
- ' so we need to unobserve the fields while we play ads so we don't record the wrong positions
- video_player.unobserveField("position")
- video_player.unobserveField("state")
- if m.ads.play_ads(video_ads_to_play)
- ' track the sites - playback that this ad has completed
- ga_track_event("sites - playback", video_player.content.site_uuid, m.ads.ga_label)
- video_player.seek = curent_position
- video_player.control = "play"
- else
- 'The user backed out of the ads
- video_player.visible = false
- end if
- end if
- end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement