1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Plex HTML5 App WorldWide Request

Discussion in 'Developers Corner' started by jgametest, Dec 17, 2013.

  1. Jan 26, 2014 #61 of 457
    jgametest

    jgametest New Member

    117
    0
    Oct 30, 2013
  2. Jan 27, 2014 #62 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    Yea, the plexpass thread just has a bunch of people requesting it, nobody is actually trying to do anything about it. I think it's fair to say that we (in this thread) have gotten the furthest. The good news is that because the Tivo supports MPEG-DASH, it should be possible, which is better than we were before when we thought it was going to be impossible because of lack of HLS support. The problem is that it is going to take a lot of work because Plex outputs what is in-effect a proprietary MPD file (containing those variables I mentioned earlier).

    For this to work, somebody would have to write some Javascript to parse the proprietary MPD file, fill in the proper variables and make the calls to get the individual chunks. The rest can then be handled by passing the chunks to the MediaSource API. The Plex javascript for chromecast I posted earlier, already does all of this but it is obsfucated so its not easy to figure out how. Nevertheless, if somebody were good with Javascript they could probably repurpose the Chromecast javascript.

    My problem is that I'm no longer a developer, and my skills are pretty rusty. Further, work is going to become pretty busy for me over the next 3-months, and therefore I don't have the considerable time (given my rusty programming skills) it would take for me to make this happen. Although, I believe there is enough information in this thread to give someone else the tools needed to make this happen.
     
  3. Jan 27, 2014 #63 of 457
    jgametest

    jgametest New Member

    117
    0
    Oct 30, 2013
    Do you think our outcome would be more interesting if we tried to launch this as an open request from Kickstarter? It seems if the reason is enough and has a big fan base things happen. Look at the results of the Veronica Mars Movie or products that launched from it.

    Perhaps we could make a plea to any or all willing participants to donate either time or funds to get this idea off the ground. It seems like all though our hearts are in the right place we are against a few factors (Time and Money).

    https://www.kickstarter.com/
     
  4. Jan 27, 2014 #64 of 457
    bradleys

    bradleys It'll be fine....

    3,687
    4
    Oct 31, 2007
    TiVo doesn't have nearly that kind of user base to support a Kickstarter program...

    And frankly, I do not think you would like the end product anyway of these video / audio limitations cannot be overcome.

    I will continue to use PyTiVo to transfer content from my library - and if I get really tired of that lutdated solution, I will pick up a cheap Chromecast.
     
  5. Jan 27, 2014 #65 of 457
    jgametest

    jgametest New Member

    117
    0
    Oct 30, 2013
    I'm thinking I am close to declaring defeat. We have 5 days before our cable is cut off. Wife has been recording as much as possible for the kids (shows) that are not available on Hulu or Netflix. It's funny since I have been searching so much on Amazon for Chromecast and Roku in Bing, this is all the ad's that hit my browser on my laptop. Now my inquiry nags me trying to appeal for an answer. That's what I call aggressive advertising. ;)
     
  6. Jan 27, 2014 #66 of 457
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    pyTivo, lutdated? Pshaw, I say.
     
  7. Jan 27, 2014 #67 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    Again, I reiterate that it this is almost certainly possible. There shouldn't be any video limitations, but it's possible that we can only achieve 2.0 audio.

    For me, it's not about the money, so a kickstarter doesn't mean anything. I truly don't have the time.

    If someone could convince the Plex devels, to let us have a look at the chromecast JavaScript unobsfucated, then it may be more achievable in the short term.
     
  8. Jan 27, 2014 #68 of 457
    bradleys

    bradleys It'll be fine....

    3,687
    4
    Oct 31, 2007
    Interesting typo...
     
  9. Jan 27, 2014 #69 of 457
    wmcbrine

    wmcbrine Ziphead

    10,369
    22
    Aug 2, 2003
    I just copied it from your post.
     
  10. Jan 27, 2014 #70 of 457
    bradleys

    bradleys It'll be fine....

    3,687
    4
    Oct 31, 2007
    I know - I was talking about "my" interesting typo. And my intention wasn't to offend, I have been using PyTiVo for years...

    OTOH, the only SD menu that ticks me off is the "My Videos" share, and I can't watch videos from my library on my Minis...

    I use the PyTiVo shares a lot!
     
  11. Aug 9, 2014 #71 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    Ok. I have good news and bad news.

    First, the good news. I GOT IT WORKING!!

    I hacked the google javascript code I posted earlier and the LG interface. It is fully working, but very hacked together.

    Now, the bad news. I have a very limited amount of time to work on this. So, it would probably take me months until I could get something release ready. So, I will post it at some point in the very near future, and hopefully someone else can take it from there.
     
  12. Aug 9, 2014 #72 of 457
    jmbach

    jmbach der Neuerer

    1,558
    10
    Jan 1, 2009
  13. Aug 10, 2014 #73 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    I'm not sure how active that development is since the developer seems to have gone radio silent for the last few weeks.

    In any event, my code can be downloaded below:

    https://mega.co.nz/#!Q1V0zC5J!dz3fTJppSpMZbwIg8V3aGwbCMgwP7cM4WhsY9lrHThA

    You need to run it in a web server, and then point the Tivo to it via the URL loader. As I said before it is very preliminary, and the code is pretty hacky. But I think it is a pretty good start.

    A few issues I know about:

    • It's painfully slow if a you have a big library <--this will take some more serious tweaking with how the posters from TV Shows and Movies are displayed.
    • The sliders are visible in some of the library menus <--I'm sure this is some weird CSS thing. I'm a novice those when it comes to that kind of stuff
    • There seems to be some remnants of previous screens when you transition through the pages
    • No fast forwarding and rewinding <--this might require some effort, but its possible
    • The timer bar when a movie is playing is not working <--should be pretty easy to get working
    • Resuming from a place within a video doesn't work <--should be pretty easy
    • Subtitles are on by default <- this is really easily fixed. Just tweak a setting in inside the transcoder.
    • Display is slightly askew on a Mini. Works fine on my roamio though.
     
  14. Aug 10, 2014 #74 of 457
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    Great progress!

    Something doesn't look right in some of the code though. In system/script/player.js the forward & rewind functions make references such as:
    this.media.playPosition
    this.media.playTime
    this.media.seek(pos);

    However this.media = document.getElementById("v") and in player.html:
    <video id="v" width="1280" height="720" ></video>

    i.e. It's an html5 video object which doesn't have the above properties or the seek function, so I'm confused by the above?

    Back when I implemented my trial player, I used video object "currentTime" property for setting play position. So in this case for skip forwards it should be something like:
    this.media.currentTime += 30;
    clearInterval(this.timer);
    And for skip backwards, something like:
    this.media.currentTime -= 8;
    clearInterval(this.timer);

    However, in this application the above sometimes work as expected but mostly not - i.e. very flaky behavior. It seems related to how much video buffer is available whether they work or not. And for a transcoding application I don't know if time-based positioning will work properly?

    And for calculating scrollbar pct position it would be:
    this.media.currentTime*100/this.media.duration
    The above returns consistent/proper number so can be used to set scrollbar position.
     
  15. Aug 10, 2014 #75 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    Ok. I've got one better. I got HLS working!

    All you need to do is change the Plex transcode profile to make the audio AAC, and everything works. If you point it to the m3u8 file in the video tag.

    To be clear: plex initially returns an MPD file, which points to the .m3u8 file. You would need to deal with that, but that is super simple - not true, the mpd file works too

    Since dash is super complicated to get working, that seems like the much easier path.

    Also with respect to the seeking. It doesn't look right because I left a bunch of the old code in there from the LG app. That's why you are confused. You can assume that any code you find in there is from the LG app, and needs to be retrofitted to work.
     
  16. Aug 10, 2014 #76 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    I've updated the code to work with HLS instead of dash

    It can be downloaded here:

    https://mega.co.nz/#!A4UnGB6C!3XNMhqwGX1r5LUm4yHe84uGII4wx8G0OeqWMKfdDvto

    The buffer bar, fast forward and rewind should be working now.

    The only thing left to fix is the GUI stuff, and then its ready to roll.

    Inside the zip is a file called "Tivo.xml" place that in your profiles directory in your Plex install

    edit: wrong url, it's now fixed

    edit2: ff/rewind does not seem to be working. It works in safari though, so it might be a limitation of the Tivo

    edit3: I "fixed" the weird fading that occurs when you transition from the section titles to the recently added items. I just disabled the previews.
     
  17. Aug 12, 2014 #77 of 457
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    There are still some issues with time display (for me the "total" part of "current/total" doesn't display) and the time bar is not updated - those can probably be fixed pretty easily. However setting currentTime doesn't seem to work at all now so skip forwards and backwards don't work. I don't think it's entirely TiVo Opera browser issue because I was able to get skip to work in my non transcoding prototype TiVo media player. But that was probably about a year ago or longer, so I need to go back and try that again to see if it still works there. It could be related to how Plex serves up the video to the TiVo Opera browser that is the issue.
    Without functioning skip the usefulness of this application is greatly reduced.
    I haven't yet tried FF/REW (instead of skip) accomplished by changing play back speed to see if that works yet.
     
  18. Aug 12, 2014 #78 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    I'm starting to think that might be an HLS thing. But I'm not sure.

    The reason why the bar is messed up has to do with the duration element. It seems to be returning NaN. The easy fix is to just grab the duration from the plex XML.

    I worked on this a bit more last night, and got it fixed up.

    One issue left that I'm having trouble with is the aspect ratio. In my version using dash it seemed to work fine (the video element would automagically resize). For the HLS version, the aspect ratio is off (the video element just sizes to the full scree). I'm not an HTML/CSS expert, so I'm kind of at a loss with this one.
     
  19. Aug 12, 2014 #79 of 457
    moyekj

    moyekj Well-Known Member

    11,151
    35
    Jan 23, 2006
    Mission...
    For the aspect ratio issue if you look at video element in player.html it defines width & height as 100% which I don't think was the case for the Dash version:
    Code:
    <video
        width="100%"
        height="100%"
        autoStart="true"
        id="player">
    </video>
    
    I suspect the issue may be that. Perhaps removing those width/height parameters would fix the problem?

    I think the duration issue can be resolved by getting duration inside video object "loadedmetadata" trigger event, since the property doesn't get set until the video is loaded and when that event is triggered.

    A question for you. When working on this I find it very frustrating that the TiVo Opera browser seems to cache code, so when I make changes to code and run it again on the TiVo, I don't have a way to clear the cache and force my updated code to be loaded. I end up renaming a bunch of files and giving a different URL to the URL Loader to make it work, but that gets old in a hurry. Do you know a way of clearing/flushing the TiVo Opera browser cache short of rebooting the TiVo?
     
  20. Aug 12, 2014 #80 of 457
    ntlord

    ntlord New Member

    183
    0
    Nov 30, 2013
    I tried that. I think I had 1280x720 in the dAsh version. No go. I also tried no parameter and just setting width to 100%. Also no go
     

Share This Page