Advertisement
Guest User

Untitled

a guest
Jan 19th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function ovguide_app(external_params)
  2.  
  3.     app = {}
  4.     app.deep_linking_data = external_params
  5.     app.ads = ads()
  6.     app.init = showChannelSGScreen
  7.     return app
  8.  
  9. end function
  10.  
  11. 'Main function loop I do:
  12. m.ads.set_video_content(video_player.content)
  13. curent_position = video_player.position
  14.  
  15. if curent_position <> invalid and curent_position > 0
  16.     video_ads_to_play = m.ads.ads_to_play(curent_position)
  17.    
  18.     if video_ads_to_play <> invalid
  19.        
  20.         video_player.control = "stop"
  21.         ' For whatever reason, the ad player begins to send position to the video player
  22.         ' so we need to unobserve the fields while we play ads so we don't record the wrong positions
  23.         video_player.unobserveField("position")
  24.         video_player.unobserveField("state")
  25.         if m.ads.play_ads(video_ads_to_play)
  26.            
  27.             ' track the sites - playback that this ad has completed
  28.             ga_track_event("sites - playback", video_player.content.site_uuid, m.ads.ga_label)
  29.            
  30.             video_player.seek = curent_position
  31.            
  32.             video_player.control = "play"
  33.  
  34.         else
  35.             'The user backed out of the ads
  36.             video_player.visible = false
  37.         end if
  38.     end if
  39. end if
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement