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: 
bblackmoor
Channel Surfer

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

I have a question, and it may require some manually editing of the python to do it, which is fine, but python is not my thing, so I need a hint... but here's the question:

The cover images I have for videos are normally roughly 2:3 or 3:4 aspect ratio -- you know, the normal movie thumbnail aspect ratio. My Media squashes them all into squares. Is there a way to change the thumbnail code so that the aspect ratio is unchanged? If it must be a square for some reason, I'd rather the image be cropped than have it distorted, but ideally it would just resize to the correct height and not be cropped at all. And, ideally, it would not break the covers for music, which are squares.

I can probably modify the code myself, if you give me a hint where to start.

P.S. I love MyMedia. Thank you again for writing it and sharing it with us.
0 Kudos
renojim
Community Streaming Expert

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

The squares and the stretching are part of the channel code; it's a bit unfortunate.  I wouldn't say it's not possible to modify the Python server code to "pre-distort" the posters, but it's better handled in the channel code.  My heavily modified personal version of the channel uses portrait aspect ratio images for anything under my "Movies" folder and squares elsewhere.

I don't want to update the channel at this point since it really needs to be rewritten to support the new SDK.  The channel may become inoperative at the end of this year.  Since I use the channel more than any other, I will update it, but I'm not sure when I'll get to it.  When I do I'll revisit the posters.

A heads up, it looks like the latest beta firmware breaks the Python server.  I can't say it's a firmware bug (or a bug in the server necessarily), but when the firmware is released it may be necessary to add a line to the server code.

-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
bblackmoor
Channel Surfer

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

Wow. Okay. Well, I have coded in java, php, a little C, and bash, perl, and so on. If I can help somehow, please let me know.
0 Kudos
bblackmoor
Channel Surfer

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

Here's another question: is there a way to change the theme of the MyMedia channel, so that the colors are darker? Having the screen go bright white when I switch between videos is light a spotlight when I am watching shows late at night. Again, if this is something I might be able to assist with, please let me know.
0 Kudos
renojim
Community Streaming Expert

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

Themes have been supported for a while, but it's been so long that I almost forget how it's accomplished.  🙂  I've always hated the bright backgrounds, so I've been using a dark theme forever.  Try saving this to colors.xml in your "client/images" directory:
<?xml version="1.0" encoding="iso-8859-1"?>
<colors>
  <BreadcrumbTextLeft>#07B27D</BreadcrumbTextLeft>
  <BreadcrumbTextRight>#FAFAFA</BreadcrumbTextRight>
  <BreadcrumbDelimiter>#69B79F</BreadcrumbDelimiter>
  <ButtonMenuNormalText>#404040</ButtonMenuNormalText>
  <BackgroundColor>#202020</BackgroundColor>
  <TextScreenBodyBackgroundColor>#202020</TextScreenBodyBackgroundColor>
  <TextScreenBodyText>#07B27D</TextScreenBodyText>
  <TextScreenScrollBarColor>#404040</TextScreenScrollBarColor>
  <TextScreenScrollThumbColor>#07B27D</TextScreenScrollThumbColor>
</colors>


There should be various JPEGs in the "client/images" directory that you can also customize.

-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
bblackmoor
Channel Surfer

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

Splendid! Here are some replacement images that suite your darker theme. I added "Loop All" and "Play New", which were missing (at least, they were missing for me).

images.zip
0 Kudos
renojim
Community Streaming Expert

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

Thanks, I'll take a look. There was a "high contrast" theme created a while back that should be in the "themes" directory that you might want to look at.

-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
bblackmoor
Channel Surfer

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

I recently upgraded my media server to Ubuntu 18. After I did, navigation became extremely slow, but only in directories with images -- directories with nothing but videos are peppy as always. I ran these commands:

sudo apt-get install libjpeg-dev libpng-dev
sudo apt-get install python-dev
sudo apt-get install python-pil
sudo shutdown -r now

After the server rebooted, I restarted the Roku. The problem persists.

I looked at the my_media_log.txt file, but it is empty (0 bytes).

I looked at the screen session where the mymedia process is running, and when I navigate MyMedia, I see a lot of error like this:

192.168.1.120:34320 - - [08/Dec/2018 09:57:15] "HTTP/1.1 GET /media" - 500 Internal Server Error
Traceback (most recent call last):
  File "/usr/local/bin/mymedia/server/web/application.py", line 243, in process
    return self.handle()
  File "/usr/local/bin/mymedia/server/web/application.py", line 234, in handle
    return self._delegate(fn, self.fvars, args)
  File "/usr/local/bin/mymedia/server/web/application.py", line 413, in _delegate
    return handle_class(cls)
  File "/usr/local/bin/mymedia/server/web/application.py", line 388, in handle_class
    return tocall(*args)
  File "/usr/local/bin/mymedia/server/mymedia.py", line 891, in GET
    web.header("Content-Type", "image/" + type)
TypeError: cannot concatenate 'str' and 'NoneType' objects

I added code to test for the None type, changing line 891 in /usr/local/bin/mymedia/server/mymedia.py from this:

      web.header("Content-Type", "image/" + type)

To this:

      if type is None:
        web.header("Content-Type", "image")
      else:
        web.header("Content-Type", "image/" + type)
That got rid of the type error, but the navigation is still painfully slow. Any suggestions?

Thanks again for MyMedia. It's one of my most often-used Roku channels.
0 Kudos
bblackmoor
Channel Surfer

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

I wondered if maybe the dev libraries were causing a problem, so I removed them:

sudo apt-get remove libjpeg-dev libpng-dev python-dev

MyMedia still works, but the navigation is still painfully slow.
0 Kudos
bblackmoor
Channel Surfer

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

I tried upgrading to python 3 (I am currently using python 2.7), but eventually tired of trying to fix the code to be compatible.

I then tried installing python 2.6, but after banging my head against getting the modules working, I gave up on that.

I do not know if either of those would have fixed the.

slow.

navigation.

in.

Roku.

but it was worth a try. I am open to suggestions.
0 Kudos