Forum Discussion

veerareddya's avatar
9 years ago

PreBuffer method is not working in rovideoscreen

Hi 

I want to preBuffer my playback video to reduce the time between ad and palyback content. so for that i'm trying to use preBuffer() method in "rovideoscreen",but it is not working.
can anyone help me on this?



    port = CreateObject("roMessagePort")
    video = CreateObject("roVideoScreen") ' creating VideoScreen object
    video.setMessagePort(port)
   
    videoclip = CreateObject("roAssociativeArray")
    videoclip.StreamFormat = "hls"
    videoclip.Stream = {url : "http://moviesyupp4-vh.akamaihd.net/i/549719/ODEA/yuppnetworks/hindi/9xm/2017/may/3rd/25939_,600,1200,1800,2500,k.mp4.csmil/master.m3u8",quality:false,bitrate:1100}
    videoclip.Title = "Playing video"
    videoclip.SwitchingStrategy = "full-adaptation"

    video.SetContent(videoclip) 'setting the content to VideoScreen object
    video.PreBuffer() ' calling pre-buffer function

    'Pre-roll ad code
    adIface = Roku_Ads() ' initializing RAF library
    adIface.setDebugOutput(false)
    'setting VAST url
    adIface.setAdUrl("http://pubads.g.doubleclick.net/gampad/ads?slotname=/124319096/external/ad_rule_samples&sz=640x480&ciu_szs=300x250&unviewed_position_start=1&output=xml_vast3&impl=s&env=vp&gdfp_req=1&ad_rule=0&vad_type=linear&vpos=preroll&pod=1&ppos=1&lip=true&min_ad_duration=0&max_ad_duration=30000&cust_params=deployment%3Ddevsite%26sample_ar%3Dpremidpostpod&url=&video_doc_id=short_onecue&cmsid=496&kfa=0&tfcd=0")
    ads = adIface.getAds()
    adIface.setAdExit(true)
    playContent = true
    playContent = adIface.showAds(ads) ' calling ads

    ' Playback starts
    if(playContent = true)
        video.show()
    endif   

    while true
      msg = wait( 0, port )
      ' process msg here
    end while

 
No RepliesBe the first to reply