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: 
Tasevski
Binge Watcher

BUG: RAF CSAS - the user is able to skip over the ads

If you create a stitched stream with enableJITPod() set to true the user can seek over the ad blocks in the video without triggering them.

Steps to reproduce (code borrowed from the scenegraph-master-sample):

' here we retrieve all ads and configure it to our playback
sub PlayContentWithAds()
	' `parentNode` is the node to which the stitched stream can be attached (passed as 2nd argument of renderStitchedStream)
	parentNode = m.top.GetParent()
	content = m.top.content
	m.top.lastIndex = m.top.startIndex ' assume that index of last played item equals to index of first played one
	items = content.getChildren(-1, 0)
	' This is the main entry point for instantiating the ad interface.
	' This object manages ad server requests, parses ad structure, schedules and renders ads, and triggers tracking beacons.
	RAF = Roku_Ads()
	RAF.enableJITPods(true)
	RAF.enableAdMeasurements(true)
	' Set the ad URL to be used for a new getAds() request.
	RAF.SetAdUrl("")

	keepPlay = true
	index = m.top.startIndex - 1
	itemsCount = items.Count()
	while keepPlay
		' check if playlist isn't complete
		if itemsCount - 1 > index
			' we need to give parentNode a focus in order to handle "back" button key press during ads retrieving
			parentNode.SetFocus(true)
			index++
			item = items[index] ' contentNode of the video which should be played next
			' Content details used by RAF for ad targeting
			RAF.SetContentId(item.id)
			if item.categories <> invalid
				RAF.SetContentGenre(item.categories)
			end if
			RAF.SetContentLength(int(item.length)) ' in seconds
			adPods = RAF.GetAds() ' ads retrieving
			m.top.lastIndex = index ' save the index of last played item to navigate to appropriate detailsScreen
			' combine video and ads into a single playlist
			csasStream = RAF.constructStitchedStream(item, adPods)
			' render the stitched stream
			keepPlay = RAF.renderStitchedStream(csasStream, parentNode)
		else
			keepPlay = false
		end if
	end while
end sub

It can be reproduced always if the provided URL has a few midroll ads, and the user can seek over them. Run the channel (scenegraph-master-sample, VideoAds) and start playback of any video. Seek forward, and move past the midroll ad start position; observe that the ad-pod wasn't triggered and that non-ad content at that position is playing.

Remove, or comment out RAF.enableJITPods(true) from the above code, run the channel (scenegraph-master-sample, VideoAds) and repeat the steps. Observe that after seeking, the jumped over ad-pod is triggered and that ads are playing and not the non-ad content.

Expected behavior

Not sure what the expected behavior should be here, as there is nothing in the docs for this scenario, but I think that the last ad-pod the user has jumped over should be played instead of the main content.

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.