nithyaak
12 years agoVisitor
Mid roll video help
I managed to get the pre-roll video ad get played by following VAST example . I am currently trying to insert a mid roll ad. i can successfully launch mid roll (e.g. every 30 seconds in this testing below) however upon the mid roll finishes, its exiting the previous channel ( in this case live hls streaming) which I paused before i playing this mid roll and which makes to return to posterscreen. below is my code snip. hope somecan can shed some light what i am doing wrong here! ( I am using the SDK sample videoplayer to do this) .
in
in
Function showVideoScreen(episode As Object , index as Integer)
...
timer=createobject("rotimespan")
timer.mark()
while true
msg=screen.GetMessagePort().getmessage()
if type(msg) = "roVideoScreenEvent" then
'print "showVideoScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "appVideoScreen::showVideoScreen::Screen closed"
exit while
else if msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
else if msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
else if msg.isButtonPressed()
print "appVideoScreen::showVideoScreen::Button pressed: "; msg.GetIndex(); " " msg.GetData()
else if msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
RegWrite(episode.ContentId, nowpos.toStr())
' print "isPlaybackPosition: "; nowpos
'mid roll...
if timer.totalmilliseconds() > 30000 then
print "inside timer block ...."
screen.SetGuidedTrickPlay(true)
screen.pause()
print "paused"
CanvasBlock=CreateObject("roImageCanvas")
CanvasBlock.SetLayer(0,"#000000")
CanvasBlock.Show()
if Showmidroll()
print "After playing midroll"
screen.Resume()
end If
timer.mark()
CanvasBlock.Close()
end If
else
' print "Unexpected event type: "; msg.GetType()
end if
else
'print "Unexpected message class: "; type(msg)
end if
end while
End Function