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: 
raghu1111
Visitor

Re: My Media - Your Music and Video on the Roku DVP

"elio2001" wrote:
I wish try the patch because i need directory order based on new files or randomized sequence.
I'll post a client modification path for shuffling the XML directory listing. Some little test.

I am not sure how familiar you are with patch files, I am placing it at http://dl.dropbox.com/u/24221441/mymedia-date-sort.txt

If you just want random order, it would be even simpler. Look for 'items.sort(item_sorter)' in getdoc method in mymedia.py.
You can do something like

if key == "video" : # for flexibility you could check if a file '.sort_order_random' exists in the directory.
random.shuffle(items) # you need to add 'import random' at the top.
else: #default
items.sort(item_sorter)
0 Kudos
raghu1111
Visitor

Re: My Media - Your Music and Video on the Roku DVP

"renojim" wrote:
As an aside, there's several changes or improvements that I'd like to make to the client side, but the channel was created by el.wubo and he sort of shows up every few months and then goes away. I still feel it's his channel. I may try to contact him to see if he still has any interest in it.

does it mean you can't update the client side with any fixes to the channel? It is very natural for many open source projects to have a fork or change or gaurd (or both). I hope el.wubo lets you update the client side or you could fork it.
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

I can't update the private channel or anything on github. We had a very brief discussion about both of us being able to update the private channel some time ago, but nothing came of it and I've been busy with a lot of other things. I'm not sure that I'm competent enough with git to handle github. In a couple of weeks one of the biggest things in my life that has been taking up a significant amount of my time will be finished, so I'll try to get in contact with him then. I don't really want to create another private channel because as I said I feel it's his channel.

That's an interesting way to add a "Shuffle" feature to videos. I was going to add it to the client (eventually), but this will work until then since anyone can change the server.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
elio2001
Visitor

Re: My Media - Your Music and Video on the Roku DVP

This is my contribution for randomizing videos applied to the function LOOP ALL (Now mean: LOOP ALL RANDOMIZING). The patch will be applied only to the client side application, appMain.brs).
Any comments are appreciated.


Function buildVideoContent(vids as Object, posters as object, all as Boolean) as Integer
' Removes any sub-directories and other non-videos from the 'posters' list and builds
' an array of videos to be passed to the roVideoScreen component
print "buildVideoContent"

maxidx = posters.Count() - 1
numvid = 0

'***
'*** new code for randomizing videos sequence
'***
first = Rnd(maxidx)
print "Num. Elements: " + toStr(maxidx)
slidesorder = GenerateMediaOrder(maxidx, first, True)
numslides = slidesorder.Count()
For i = 1 To numslides
print "index: " ToStr(i) + "-" + ToStr(slidesorder[i])
item = posters[i].item
print "video: " item.GetTitle()
print "--"
End For
y = 0
For x = 0 To maxidx
y = slidesorder[x]
If y <= maxidx Then
i = slidesorder[x]
item = posters[i].item
If item.GetContentType() = "movie" And Not item.GetStreamFormat() = "hls" Then
If all Or Not Left(posters[i].ShortDescriptionLine2,5) = "Watch" Then
vid = item.GetPlayable()
vid.index = i
numvid = numvid + 1
vids.Push(vid)
End If
End If
End If
End For
return numvid
'***
'*** end new code
'***

'***
'*** original (commented) old code
'***
' for i = 2 to maxidx ' skip Playall posters
' item = posters[i].item
' if item.GetContentType() = "movie" and not item.GetStreamFormat() = "hls" then
' if all or not Left(posters[i].ShortDescriptionLine2,5) = "Watch" then
' vid = item.GetPlayable()
' vid.index = i
' numvid = numvid + 1
' vids.Push(vid)
' end if
' end if
' end for
' return numvid
End Function

'****
'**** New routine added to the source
'****
' generate an array of indexes to use for accessing media in the order specified
' index is what we want the first one to be.
' israndom tells us to randomize the rest of the slots
Function GenerateMediaOrder(count, index, israndom)
print "GenerateMediaOrder"
slideorder = [count]
i = 0
while i < count-index
slideorder[i] = i+index
i = i+1
end while
while i < count
slideorder[i] = i - (count-index)
i = i+1
end while

if israndom
' now shuffle them up, except for the first one
i = 1
while i < count
newpos = rnd(count-1)
oldval = slideorder[newpos]
slideorder[newpos] = slideorder[i]
slideorder[i] = oldval
i = i+1
end while
endif
return slideorder
end Function

0 Kudos
athirukk
Visitor

Re: My Media - Your Music and Video on the Roku DVP

"renojim" wrote:
In a couple of weeks one of the biggest things in my life that has been taking up a significant amount of my time will be finished, so I'll try to get in contact with him then.
-JT


Can we expect something like 'MyMedia' or any useful channel out of you? 😄
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

"athirukk" wrote:
Can we expect something like 'MyMedia' or any useful channel out of you? 😄

I'm not sure how to take that?!

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
raghu1111
Visitor

Re: My Media - Your Music and Video on the Roku DVP

"renojim" wrote:
No, but at one time it was on my list of things of things to add. I don't find them all that useful and it seems to be a lot of trouble to create them. You're the first person to ask for BIF support.

This would be a nice feature. very useful especially for TV programs to skip ads. Can this be implemented on the server side or does it need client side fix?
0 Kudos
renojim
Community Streaming Expert

Re: My Media - Your Music and Video on the Roku DVP

It requires changes on both sides. I've already implemented it on both sides (it was fairly trivial), but as I've said I have no way to update the channel or anything on github. I don't know if you've tried to create the BIF files. They're a little bit of a pain to create, but I have a usable method and I believe someone posted a method somewhere in the forum as well. I believe it was for Windows, so you may want to start investigating creating them from Ubuntu. ffmpeg can be used to create the JPEGs, but the Windows version at least requires one JPEG to be dropped and the indices to be renumbered starting from 0.

-JT
Roku Community Streaming Expert

Help others find this answer and click "Accept as Solution."
If you appreciate my answer, maybe give me a Kudo.

I am not a Roku employee.
0 Kudos
raghu1111
Visitor

Re: My Media - Your Music and Video on the Roku DVP

We can upload our version of the client to Roku. it would be very useful to have your changes available some where.
If you haven't already, could you please 'fork' the source on github.com and apply your patches there? It does not mean you are creating a competing 'MyMedia'.. this is how all the github projects work. If I want to submit a patch to a project, I fork it first, then apply my patch and ask the main project owner(s) to merge it.

We can discuss on email or pm if you need any help with uploading your patches. If you want I can maintain a fork for you.

BIF files are pretty straight fwd to create. There is nice python script at https://bitbucket.org/bcl/homevideo/src ... makebif.py (part of 'homevideo' project) that uses ffmpeg to create jpegs. I have tried it and FF and REWIND are so much better with these.
0 Kudos
raghu1111
Visitor

Re: My Media - Your Music and Video on the Roku DVP

I see https://github.com/renojim/roku_media_server/ , but does not seem to be update since Feb 2010.
0 Kudos