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

playall videos like onion news network

Endless how did you get this to work?

I just added this channel and i really like how that works.

Can you share with us how you got this play all in the category list? this would be great for youtube btw!! wonder if chris could do something similar as well would make that experience smoother.
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
27 REPLIES 27
RokuChris
Roku Employee
Roku Employee

Re: playall videos like onion news network

Chris prefers having the "Play All" button on the springboard. That way the user can begin the play all experience from any video in the list.
0 Kudos
dynamitemedia
Binge Watcher

Re: playall videos like onion news network

Chris you know i saw that play all and i thought i tried using it once and it didnt work, but i just went back and tried it and I love it!! thanks Chris it works awesome

So can you guys let us in on how you did this? and some code snipplet would be awesome.

I think i might like to add this, in the trailers sections as they are always short clips
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: playall videos like onion news network

I use essentially the logic discussed in this thread viewtopic.php?f=34&t=32867
0 Kudos
dynamitemedia
Binge Watcher

Re: playall videos like onion news network

Chris,
i got this "somehwhat" working....

here is my code, using the videoplayer example appVideoScreen.brs

Function showVideoScreen(episode As Object)

if type(episode) <> "roAssociativeArray" then
print "invalid data passed to showVideoScreen"
return -1
endif

url = "http://xxx.com/get/IptvMyWay-670.m4v"
fmt = "mp4"

url2 = episode.StreamUrls
fmt2 = episode.StreamFormat

print " this is the url: ";url2
print " this is the Format: ";fmt2


videoArray = [
{
Stream: { url: url }
StreamFormat: fmt
},
{
Stream: { url: url }
StreamFormat: fmt
}
]


for each video in videoArray


screen = CreateObject("roVideoScreen")
screen.SetMessagePort(CreateObject("roMessagePort"))
screen.SetPositionNotificationPeriod(30)
screen.SetContent(video)
screen.Show()

'Uncomment his line to dump the contents of the episode to be played
'PrintAA(episode)

while true
msg = wait(0, screen.GetMessagePort())


if type(msg) = "roVideoScreenEvent" then
print "showHomeScreen | msg = "; msg.getMessage() " | index = "; msg.GetIndex()
if msg.isScreenClosed()
print "Screen closed"
exit while
elseif msg.isRequestFailed()
print "Video request failure: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isStatusMessage()
print "Video status: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isButtonPressed()
print "Button pressed: "; msg.GetIndex(); " " msg.GetData()
elseif msg.isPlaybackPosition() then
nowpos = msg.GetIndex()
RegWrite(episode.ContentId, nowpos.toStr())
else
print "Unexpected event type: "; msg.GetType()
end if
else
print "Unexpected message class: "; type(msg)
end if
end while
next
End Function


ok this code above works. BUT not the correct way.

the url2 and fmt2 when printed show the correct format and url.... but they will not play just goes back to the springboard screen....

the error i get is:


this is the url: http://xxxx.com/get/IptvMyWay-95.m4v
this is the Format: mp4

showHomeScreen | msg = An unexpected problem (but not server timeout or HTTP err
or) has been detected. | index = -3
Video request failure: -3 0
showHomeScreen | msg = | index = 0
Screen closed


what i don't understand is it does print out as the correct URL and Format, but it just poops out this error.
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: playall videos like onion news network

Well, the first thing I notice is that you aren't trying to play url2. You print it to the console, but it's not part of your videoArray.

Also keep in mind that anytime a screen closes, control falls back to the previous open screen. So if you don't open a canvas or some other blank screen beneath your series of video screens, you will lose control after the first video and fall back to the springboard. That was discussed in this thread: viewtopic.php?f=34&t=32501&p=206093&hilit=simulating#p204249
0 Kudos
dynamitemedia
Binge Watcher

Re: playall videos like onion news network

"RokuChris" wrote:
Well, the first thing I notice is that you aren't trying to play url2. You print it to the console, but it's not part of your videoArray.

Also keep in mind that anytime a screen closes, control falls back to the previous open screen. So if you don't open a canvas or some other blank screen beneath your series of video screens, you will lose control after the first video and fall back to the springboard. That was discussed in this thread: viewtopic.php?f=34&t=32501&p=206093&hilit=simulating#p204249


as i stated i did have it in that way but it just closes, if i keep it the way it is it plays them both just fine... the full example i had works just fine.

It is when i try addding into the array and changing it to this

videoArray = [
{
Stream: { url: url }
StreamFormat: fmt
},
{
Stream: { url: url2 }
StreamFormat: fmt2
}
]


it plays the first video but not the second video, and when i print it. It does show that the format and url are correct.
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
0 Kudos
RokuChris
Roku Employee
Roku Employee

Re: playall videos like onion news network

If the code works fine and only breaks when you change a URL, the problem could be with that content. Do you know whether that video plays on Roku at all?

Also, you're setting url2 = episode.streamURLs, which is most likely an array, but url2 needs to be a string for things to work right. If you're feeding the video screen an array where it expects a string, that could be the issue.
0 Kudos
TheEndless
Channel Surfer

Re: playall videos like onion news network

I'd bet this line is your problem: "url2 = episode.StreamUrls"

Why are you using StreamUrls here, but using the Stream associative array in your content array? StreamUrls is an array of strings, whereas Stream.Url is a single string. I don't know what "episode" looks like, but I would think that line should either be "url2 = episode.StreamUrls[0]" or "url2 = episode.Stream.Url".
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
dynamitemedia
Binge Watcher

Re: playall videos like onion news network

"RokuChris" wrote:
If the code works fine and only breaks when you change a URL, the problem could be with that content. Do you know whether that video plays on Roku at all?


yes for testing i am using the same videos from my fishing channel, its somehow in the code. because as soon as i change it back to normal it plays just fine

i was thinking it had something to do with the episode and video variables?

the video player uses

screen.content(episode)   

but i changed that to
screen.content(video) 
Twitter: iptvmyway facebook: iptvmyay
Channels: Warriors of War, Go Fight Live, Heading Outdoorz, IPTVmyway
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.