Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
veerareddya
Visitor

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

 
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.