# Enter Webz beta release - web browser for the TiVo!



## davidblackledge

Today I'm announcing "Enter Webz" - the world's first web browser for the TiVo DVR. 
This is just a Beta release.

This release is available for download from http://David.Blackledge.com/tivo/enterwebz. 
More information is in the documentation.

Just download, unzip, and run the .bat file, then look in "Music, Photos, and More" or "Showcases and Apps" or equivalent, depending on your TiVo model. 
You'll get Enter Webz, and a couple of shortcuts to Google and Archive.org (where you can listen to public domain music, or watch public domain videos and movies on your TV).

This is free for your personal home use. I plan to set up a fixed-ip server in the future.

It's ugly and buggy still, but today's the last day of my vacation, so I may not get a chance to work on this for a while.

Why a web browser for the TiVo DVR?

Quick lookups

Google, Definr.com, IMDB, Wikipedia
One-off pages for other Apps

Google Authentication for Google APIs (the main inspiration for creating Enter Webz... I used Enter Webz to register Pandoras activation code on my new TiVo Premiere!)
Display a related URL for dynamic app content (e.g. from an RSS feed)
Application help pages
Instant HME Apps for some websites

like:
weather.gov and wunderground.com
Gmail mobile or Gmail basic html
Google Voice mobile (mp3 download blocked)
Google Calendar mobile...hopefully soon
Facebook mobile
tivocommunity.com forums!
Archive.orgs public domain content:
mp3s ( playlists of live concerts; audio books), texts, videos (classic TV; movies)
Feedburner XSLT-formatted rss feeds
xkcd.com
Launch other HME Apps

Special URLs launch apps from domain names (vs. static IPs of Manually add a server)
Can be configured to present any URL like it is a stand-alone app.


----------



## Allanon

Very cool!!

I've only tried it for a few minutes and I can already see this has a lot of potential. This browser is a lot faster than the one built in to my Sony TV especially when viewing YouTube videos.

I know this is a beta version but thought it might help you to know some of the problems I found. I have a Tivo HD and found that the PIP didn't resize, only the top right corner of the video was visible in the PIP window. 

Also, I got an error when loading some web pages, it states "An error occurred while running the application. Out of memory". I tried reopening EnterWebz on the Tivo but the error occurred again as soon as the application opened. Same happened with all the other applications on the Tivo. I tried shutting down and restarting EnterWebz on my computer but same result. I had to restart the Tivo to clear the error and make it so I could use Tivo apps again.


----------



## wmcbrine

Never mind, I figured out that it requires Java 1.7.


----------



## jhilla

I am simply amazed how fast your browser is on tivo. I was zipping along from Facebook Mobile to flipping in and out of Youtube. However you were motivated, I'm in awe. Thank you soooo much we have been dreaming of this. Dang, now if only I could get my hands on that Qwerty keyboard-remote from Tivo. 

By the way, I went ahead and manually inserted the Java path in your .bat so it would load better in comparison to missing my settings. I had to do the same thing with Streambaby.

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Dcom.tivo.hme.sdk.debug.level=0 -cp "EnterWebz.jar;hme-host-sample.jar;hme.jar;bananas.jar;hme-hd-0.4.1.jar;jsoup-1.7.1.jar;cbd.tivo.jar;cbd.tivo.widgetsGadgets.jar;cbd.tivo.icons.jar" com.tivo.hme.host.sample.Main --launcher launcher.txt


----------



## davidblackledge

Allanon said:


> Very cool!!





jhilla said:


> However you were motivated, I'm in awe. Thank you soooo much we have been dreaming of this.


You're very welcome, and thank you for the compliments.



wmcbrine said:


> it requires Java 1.7.


I doubt it needs to be higher than 1.5, I'll change my compile configuration.



Allanon said:


> I've only tried it for a few minutes and I can already see this has a lot of potential. This browser is a lot faster than the one built in to my Sony TV





jhilla said:


> I am simply amazed how fast your browser is on tivo.


most of the speed is thanks to the computer you're running it on ;] ... plus JSoup. I also did a few things to make it more responsive.



Allanon said:


> especially when viewing YouTube videos.





jhilla said:


> I was zipping along from Facebook Mobile to flipping in and out of Youtube.


YouTube and Video Player: Thanks to moyekj for just recently figuring out how to launch those. 
If it sees one of the YouTube "watch" URL formats, it launches the built-in YouTube app with that video ID. I need to make it launch the new better quality app on Premieres.
To deal with large files, if it sees a video/mpeg content type (usually larger files) it launches the Video Player with that URI.
Note, in the future it will launch ALL video files over 1.1G with Video Player, but short videos will use my in-browser player (in-browser helps because you don't lose browsing history and it supports ASPECT/ZOOM to correct the video display). I need a modification to JSoup to do the size check efficiently, though.



Allanon said:


> I know this is a beta version but thought it might help you to know some of the problems I found.


This is why I released it as a beta! The more I hear, the better it can be! ;]



Allanon said:


> I have a Tivo HD and found that the PIP didn't resize, only the top right corner of the video was visible in the PIP window.


PIP is off by default because of this. If PIP stops working...just turn it off and leave it off (maybe try again the next day if you like) - although it works some of the time, it's flakey. When it's working, turning it off then on (SLOW button) gets a blank PIP until you do it again. When it stops working (not scaled) consider everything destabilized until PIP is off - I've had it crash the TiVo for a simple error while the PIP was displaying in a bad state. There is work to do to find out how to cleanly make PIP work consistently like the Premiere does. (although that's through flash so it may not be completely possible in HME).



Allanon said:


> Also, I got an error when loading some web pages, it states "An error occurred while running the application. Out of memory". I tried reopening EnterWebz on the Tivo but the error occurred again as soon as the application opened. Same happened with all the other applications on the Tivo. I tried shutting down and restarting EnterWebz on my computer but same result. I had to restart the Tivo to clear the error and make it so I could use Tivo apps again.


Out of Memory: Expect that. That's actually the TiVo running out of memory, not Enter Webz. If you're doing a lot of browsing or just have a crazy big page, we'll likely run out of TiVo memory/views/whatever. 
However, getting "stuck" out of memory I'm going to blame on the broken PIP destabilizing the HME environment... haven't seen this happen myself.

Good news is, Enter Webz remembers "last visited" so a crash doesn't lose your place.
Also, I wanted to start pyTiVo archiving with Enter Webz, but accesses to the TiVo web service while running HME is a great way to cause a system crash (perhaps pyTivo could have a mode where it only uses cached information as soon as you start accessing the web interface?)

You'll also notice inline image failures: since the TiVo is directly loading them, websites that block remote-loading also block them from the TiVo. I'm certain there is a way to give pass-through header info to the TiVo in a createStream request via the TeDict, but my best experiments so far only caused TiVo crashes (which means it tried to interpret something!).
Google Voice mp3 playing seems to have the same problem.
*Any research in this area would be really helpful! *Or just bang on TiVo's door for that one secret.

Seems I could allow Premiere users to try to launch arbitrary flash files when I find them on a page once I learn a little bit more about that.

I'm tempted to launch YouTube (and flash) "inline" on the page by using scaling and application-as-Stream, but I don't think that's useful...just cute. (you'd have to "exit" the application to get control back to Enter Webz)

FYI, when I eventually put it on a server, it will use the Premiere's new "Genre" field so a link-as-app will show up in the "photos" and "music" area or the "other" area (there is a "video" genre, but it doesn't show up anywhere - probably some additional requirements on the TiVo side - more research to do)


----------



## wmcbrine

davidblackledge said:


> FYI, when I eventually put it on a server, it will use the Premiere's new "Genre" field


The what now?

I know the Premiere likes to make requests that include "DoGenres=1", but I've never seen anything else about this.


----------



## davidblackledge

wmcbrine said:


> The what now?
> 
> I know the Premiere likes to make requests that include "DoGenres=1", but I've never seen anything else about this.


;]
Notice how the Premiere puts Live365 and Pandora and Photos in one menu, and other apps under Showcases & Apps... that's cause the TiVoConnect response (when DoGenres=1) includes the genres tag with one or more genre tags that contains "photos" "music" "video" or "other"


Code:


<Item>
<Details>
<ContentType>application/x-hme</ContentType>
<SourceFormat>x-container/folder</SourceFormat>
<Title>Photos &amp; Slideshows</Title>
<Uuid>BBC7824A-40C6-8B61-4D87-6A3D799F365B</Uuid>
<X-TiVo-TopLevelDisplayOrderHint>50</X-TiVo-TopLevelDisplayOrderHint>
</Details>
   <Genres>
      <Genre>photos</Genre>
   </Genres>
<Links>
<Content>
<ContentType>application/x-hme</ContentType>
<Url>https://204.176.49.65:7287/hdphotos-ml_2010.09.13-1339-20100913_134517/1284410719/1355864959-1671224959/clientip_75.161.43.57/</Url>
</Content>
<CustomIcon>
<Url>http://204.176.49.116:7288/hdphotos-ml_2010.09.13-1339-20100913_134517/1284410719/1355864959-1671224959/icon.png</Url>
</CustomIcon>
</Links>
</Item>

(For some reason it also includes ContentType again under the Content tag)

Anything with "photos" or "music" ends up under that group, "other" under Showcases & Apps, and "video" (if that's the only genre) disappears... Genre "video" is how Netflix, YouTube, Hulu, etc. end up in the two video locations, obviously. To get it to show up, maybe all I have to do is call the app "<Hidden />" or maybe they have a pre-authorized list of UUIDs, or maybe it has to be https.


----------



## reneg

Pretty nice. I didn't do much with it other than load it up, but it did seems very responsive.

For whatever reason, I had to add java to my path before it would run. Maybe the batch file could check for this.

It didn't show up with the other HME apps on my Tivo HD. The Tivo HD was recording so I didn't reboot it. I moved to a Premiere where it did show up on the HME apps.

I ran it on smaller tv (about 27") and the text was barely readable. Of course I didn't read the documentation to see if there was a way to change the resolution. I'll play around with it on a larger TV.


----------



## davidblackledge

reneg said:


> For whatever reason, I had to add java to my path before it would run. Maybe the batch file could check for this.


Yeah...I'm really rusty on batch files... maybe I'll find a good sample on the Internet somewhere ;]


reneg said:


> I ran it on smaller tv (about 27") and the text was barely readable. Of course I didn't read the documentation to see if there was a way to change the resolution. I'll play around with it on a larger TV.


SD fonts are usually good, and on HD I scale the fonts up slightly since they seemed too small to me, too (on 1080), but that combined with a smaller TV is likely too small, yeah.

The webpages can be even worse if the specified fonts are very small.
Change the font scaling by pressing 1-9... 0 goes back to default (which is 5).
The THUMBtacks screen font doesn't scale...maybe I should use a larger font for HD.

I plan to add HD/SD screen resolution selection to the menu eventually
(ASPECT/ZOOM to get the ugly menu page).

Thanks for trying it out!


----------



## wmcbrine

I couldn't get Genres to work based on the above (in HME for Python); it just makes the server show up as the IP address, and the apps don't appear. I'd be interested to hear any more info you have about this, and how you found out -- it looks like you intercepted some conversations between the TiVo and tivo.com servers?


----------



## davidblackledge

wmcbrine said:


> I couldn't get Genres to work based on the above (in HME for Python); it just makes the server show up as the IP address, and the apps don't appear. I'd be interested to hear any more info you have about this, and how you found out -- it looks like you intercepted some conversations between the TiVo and tivo.com servers?


Let's see... I sort of proxied a connection using my "hme:" protocol setup. I take the two key headers the TiVo sent me and used them in a TiVoConnect request to 204.176.49.116 which gave me the content that I showed in the sample earlier.


Code:


/**
 * HTTP Header sent in resource requests by the TiVo with the tsn (context
 * connection attribute "tsn") as value
 */
public static final String HTTP_HEADER_TIVO_ID = "TiVo_TCD_ID";
/**
 * HTTP Header sent in resource requests by the TiVo with the TiVo Software
 * Version (Device Info event's "version") as value
 */
public static final String HTTP_HEADER_TIVO_VERSION = "TiVo_SW_VER";

I had an IP-only problem, too, and eventually figured out I had invalid XML I was generating... it had un-escaped ampersands. 
While trying to fix it, I also added the ?xml at beginning of the file, and Content-Type: text/xml, and that additional <ContentType in the <Content section ...not sure if they're required, though.
oh yeah, and you HAVE to have a Uuid specified. Current experiments show a random one or a non-standard one works fine, but it won't show up at all without it.


----------



## jhilla

Hi David,

I was running your app this morning and this time "EntertheWebz" was missing the hidden features of the original Youtube and Dominos Pizza that were their day one. Did you revise the list and remove it or did Tivo detect you and delete the entries? Also, I would be interested in activating the switch when hitting zoom from Mobile browser to Desktop Browser. I have a theory if we can trick the majority of domains to be a common browser it may allow more content to be played such as Nickjr, Disney and Crackle.

Thanks again,
John


----------



## Allanon

My media server (Serviio) has a webpage that allows browsing and playing videos from an internet browser. I tried accessing it using Enter WebZ but got a blue screen error that kicked me from the app. The error code was 0xffff.

My launch.txt looks like this:


Code:


com.blackledge.david.html.hme.WebBrowserApp
com.blackledge.david.html.hme.WebBrowserApp http://192.168.1.114:23424/mediabrowser "Media Server"

I also tried using localhost instead of the URL but got the same error. And I tried entering the URL manually from within the browser but the error occurred as soon as it tried to go to the webpage.

Would this be an URL problem because it's trying to access my local computer or is it a problem with the webpage?

Attached is the source code for the webpage:


----------



## davidblackledge

jhilla said:


> I was running your app this morning and this time "EntertheWebz" was missing the hidden features of the original Youtube and Dominos Pizza that were their day one. Did you revise the list and remove it or did Tivo detect you and delete the entries?


Yeah...that's a feature ;] The default list of links isn't permanent until you save one of your own. At that time, it saves all the normal links permanently, but it doesn't save the "demo" links which includes those hidden apps. If you delete all your links, it will bring back all the defaults, including the "demo" links.
The "suggested links" page is meant to hold all these defaults (and additional suggestions), but the wiki site only shows the special app-launching links in "iframes" which Enter Webz doesn't currently support. I'll add another place for the special app-launching links soon.
I may have it permanently save the "demo" links, too, since it's easy for you to delete them if you don't want them.


jhilla said:


> Also, I would be interested in activating the switch when hitting zoom from Mobile browser to Desktop Browser. I have a theory if we can trick the majority of domains to be a common browser it may allow more content to be played such as Nickjr, Disney and Crackle.


While I'm not 100% sure what you mean, most of the missing content falls under 3 categories: JavaScript, Flash, or Frames. 

JavaScript will never be supported. 
Flash MAY be supported on Premieres... though it will be hit-or-miss at best, and most likely won't work almost at all.
Frames will eventually be supported.
Other features like Silverlight and Java Applets will never be supported for sure.

As far as Zoom...that's currently to open the menu... but I might change that to "info" and use Zoom similar to what you're talking about...it might be a better fit.


----------



## wmcbrine

davidblackledge said:


> While trying to fix it, I also added the ?xml at beginning of the file, and Content-Type: text/xml, and that additional <ContentType in the <Content section ...not sure if they're required, though. oh yeah, and you HAVE to have a Uuid specified.


Yeah, I had all that. It turned out to be a typo -- I was missing the closing slash. 

It works! Sort of. (I have huge problems with the HDUI recognizing HME apps in general. Sometimes I have to switch to the SDUI to get them to show up, then back. Still have problems with the icons.)


----------



## davidblackledge

wmcbrine said:


> It works! Sort of. (I have huge problems with the HDUI recognizing HME apps in general. Sometimes I have to switch to the SDUI to get them to show up, then back. Still have problems with the icons.)


I know it caches the list... doesn't refresh nearly as often as the older models... this is nice for speed, but hard for developers ;] Things I try that seem to help force a refresh: go to standby then come back, or go to a detailed menu like system settings or something, then come back.


----------



## davidblackledge

Allanon said:


> My media server (Serviio) has a webpage that allows browsing and playing videos from an internet browser. I tried accessing it using Enter WebZ but got a blue screen error that kicked me from the app. The error code was 0xffff.
> I tried entering the URL manually from within the browser but the error occurred as soon as it tried to go to the webpage.
> 
> Would this be an URL problem because it's trying to access my local computer or is it a problem with the webpage?


Interesting. The URL isn't a problem for being local, so I'd guess it was the page, but the 0xffff is a surprise. The attached html seemed to load fine on my computer, but I don't have any of the images or stylesheet files it references, so it's probably one of them causing the problem. If there is any output from on your computer when the error happens, I'd be interested in it... probably a bug in my code not handling some weird problem with the stylesheet files.

The "good news" is... looking at the website, the URL won't do you much good because it is designed to play the videos through a Flash app that won't work on Enter Webz. 
It might be "easy" to create a Serviio-specific app using their API, though ;]


----------



## windracer

Trying to get this running on Linux. Had to upgrade to JRE 1.7 first so it would run at all. Now, when I access the app, it crashes:



Code:


[email protected]:/etc/tivo/enterwebz$ ./enter-webz.sh
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
LOG: added factory
LOG: added factory
MDNS: http://192.168.1.60:7288/webz/
MDNS: http://192.168.1.60:7288/webz1/
MDNS: http://192.168.1.60:7288/webz2/
LOG: null
LOG: Exception or Error during init():
LOG: java.lang.NullPointerException: null
LOG: Stack trace sent to stdout
java.lang.NullPointerException
        at com.blackledge.david.tivo.widgets.typo.WordList.addWord(WordList.java:129)
        at com.blackledge.david.html.hme.WebBrowserApp.init(Unknown Source)
        at com.tivo.hme.sdk.Application.initializeApp(Application.java:879)
        at com.tivo.hme.sdk.Application.preprocessEvent(Application.java:1774)
        at com.tivo.hme.sdk.Application.handleChunk(Application.java:1589)
        at com.tivo.hme.host.sample.Listener.readEvents(Listener.java:306)
        at com.tivo.hme.host.sample.Listener.handleHME(Listener.java:288)
        at com.tivo.hme.host.sample.Listener.handle(Listener.java:381)
        at com.tivo.hme.host.http.server.HttpConnection.run(HttpConnection.java:123)
        at java.lang.Thread.run(Unknown Source)
LOG: Closing app, due to previous error
LOG: unknown event opcode : 10
LOG: com.tivo.hme.sdk.HmeException: application closed, app=/webz/
LOG: Stack trace sent to stdout
com.tivo.hme.sdk.HmeException: application closed, app=/webz/
        at com.tivo.hme.sdk.Application.writeCommand(Application.java:3396)
        at com.tivo.hme.sdk.Application.cmdViewSetVisible(Application.java:2620)
        at com.tivo.hme.sdk.View.setVisible(View.java:682)
        at com.tivo.hme.sdk.View.setVisible(View.java:667)
        at com.tivo.hme.sdk.Application.handleActive(Application.java:1374)
        at com.tivo.hme.sdk.Application.handleEvent(Application.java:1329)
        at com.tivo.hme.bananas.BApplication.handleEvent(BApplication.java:362)
        at com.blackledge.david.html.hme.WebBrowserApp.handleEvent(Unknown Source)
        at com.tivo.hme.sdk.HmeObject.postEvent(HmeObject.java:145)
        at com.tivo.hme.sdk.Resource.postEvent(Resource.java:132)
        at com.tivo.hme.sdk.Application.dispatchEvent(Application.java:1869)
        at com.tivo.hme.bananas.BApplication.dispatchEvent(BApplication.java:278)
        at com.tivo.hme.sdk.Application.handleChunk(Application.java:1606)
        at com.tivo.hme.host.sample.Listener.readEvents(Listener.java:306)
        at com.tivo.hme.host.sample.Listener.handleHME(Listener.java:288)
        at com.tivo.hme.host.sample.Listener.handle(Listener.java:381)
        at com.tivo.hme.host.http.server.HttpConnection.run(HttpConnection.java:123)
        at java.lang.Thread.run(Unknown Source)
LOG: connection to receiver closed
LOG: Unexpected error: com.tivo.hme.sdk.HmeException: application closed, app=/webz/

Here's the quick shell script I wrote to run it:



Code:


#!/bin/bash
mydir=`dirname "$0"`
cd "$mydir"
for j in ./*.jar
do
CLASSPATH=$CLASSPATH:$j
done

java -Dcom.tivo.hme.sdk.debug.level=0 -cp $CLASSPATH com.tivo.hme.host.sample.Main --launcher launcher.txt

Anything obvious I'm doing wrong?


----------



## Allanon

davidblackledge said:


> If there is any output from on your computer when the error happens, I'd be interested in it...


Output:


Code:


HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
LOG: added factory
MDNS: http://192.168.1.114:7288/webz/
LOG: 192.168.1.104 icon.png HTTP GET - to factory /webz/
MDNS: http://192.168.1.114:7288/webz1/
LOG: 192.168.1.104 icon.png HTTP GET - to factory /webz1/
LOG: null
LOG: unknown event opcode : 10
Unable to create default font for measurement: java.io.IOException: Can't read C
:\Users\David\Desktop\Development\hme_sdk_1.4.1_src\com\tivo\hme\sim\default.ttf

Unable to create system font for measurement: java.io.IOException: Can't read C:
\Users\David\Desktop\Development\hme_sdk_1.4.1_src\com\tivo\hme\sim\system.ttf
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NullPointerException
LOG: 192.168.1.104 icon.png HTTP GET - to factory /webz/
LOG: 192.168.1.104 icon.png HTTP GET - to factory /webz1/


----------



## davidblackledge

windracer said:


> Trying to get this running on Linux. Had to upgrade to JRE 1.7 first so it would run at all. Now, when I access the app, it crashes
> Anything obvious I'm doing wrong?


First, sorry again about the Java 1.7 - next release will be 1.5.

I think I know what it is... I have an old version of TyPo in one of the jars, and a newer version in EnterWebz.jar. Your generated classpath probably puts the old one first in the path.
Try it with a manual classpath that matches the .bat file instead of a generated classpath.
Next release will also self-define its classpath in the main jar file, so you won't even need the loop.


----------



## windracer

davidblackledge said:


> I think I know what it is... I have an old version of TyPo in one of the jars, and a newer version in EnterWebz.jar. Your generated classpath probably puts the old one first in the path.
> Try it with a manual classpath that matches the .bat file instead of a generated classpath.


That did it. :up:


----------



## davidblackledge

davidblackledge said:


> Today I'm announcing "Enter Webz" - the world's first web browser for the TiVo DVR.
> This is just a Beta release.
> 
> This release is available for download from http://David.Blackledge.com/tivo/enterwebz.
> More information is in the documentation.


Updated beta is available for download.

Main changes:

layout improvements
changed key assignments (info for menu, aspect/zoom for mobile mode)
"thumztaks" is the new name for bookmarks
reload key (REPLAY)
CSS media type configuration
fix form submission for BUTTON tag buttons
only requires Java 1.5
batch file finds Java automatically.


----------



## jhilla

I have downloaded your new version, but the auto-discovery was unable to find my java. So again, had to modify the .conf to see it manually and that is working for me.

@echo off
rem thanks to http://chriskopec.com/blog/2009/jun/15/automatic-discovery-java_home-batch-file/

if "%JAVA_HOME%" == "" call:FIND_JAVA_HOME
echo JAVA_HOME: "%JAVA_HOME%"

rem Start Server

"C:\Program Files (x86)\Java\jre7\bin\java.exe" -Dcom.tivo.hme.sdk.debug.level=0 -jar EnterWebz.jar --launcher launcher.txt

goto:END

:FIND_JAVA_HOME
FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment" /v CurrentVersion') DO set CurVer=%%B

FOR /F "skip=2 tokens=2*" %%A IN ('REG QUERY "HKLM\Software\JavaSoft\Java Runtime Environment\%CurVer%" /v JavaHome') DO set JAVA_HOME=%%B
goto:EOF

:END


----------



## davidblackledge

jhilla said:


> I have downloaded your new version, but the auto-discovery was unable to find my java. So again, had to modify the .conf to see it manually and that is working for me.


Darn, it worked for me. Maybe I can add some instructions for that case... the preferred fix is to set your JAVA_HOME system environment variable to (in your case) "C:\Program Files (x86)\Java\jre7" - the script is just trying to set that variable if you didn't already set it.
Setting that variable will help you with a lot of other Java batch files, too.

Thanks for letting me know!


----------



## jhilla

Well without realizing you solved a major problem for us, we use youtube on tivo frequently but since the wishlist is not integrated for youtube one most continually type in search quiries. However with you giving us the thumblinks and it autosaves the name inquiry. Well that's just awesome so, Thank you. Now, call me stuborn but the one thing I wish could be replicated is adding "EnterWebz" as service instead of runing it manually.

The main reason I ask about Font Save, is level 5 is a pretty good setting on my HDTV. But it only saves it for that session, so naturally I have to "INFO" and set it again each time reload.


----------



## jhilla

Could Kylo Browser but adopted into EnterWEBZ are is this opensource technology not cross compatable at this time?

http://kylo.tv


----------



## davidblackledge

jhilla said:


> Well without realizing you solved a major problem for us, we use youtube on tivo frequently but since the wishlist is not integrated for youtube one most continually type in search quiries. However with you giving us the thumblinks and it autosaves the name inquiry. Well that's just awesome so, Thank you.


Excellent, I had hoped that some missing features of the Youtube app would work this way!


> Now, call me stuborn but the one thing I wish could be replicated is adding "EnterWebz" as service instead of runing it manually.


If you use Galleon, it should be possible to let it host Enter Webz. 
Also, I believe there are some programs on the Internet that can make a script run as a service... maybe I'll figure out how to include that with Enter Webz some day.



> The main reason I ask about Font Save, is level 5 is a pretty good setting on my HDTV. But it only saves it for that session, so naturally I have to "INFO" and set it again each time reload.


That makes sense... I think I will make it save the setting, then. FYI, you can just press the # key on the web page to change font size, so you don't have to press "INFO" for that feature.



jhilla said:


> Could Kylo Browser but adopted into EnterWEBZ are is this opensource technology not cross compatable at this time?
> 
> http://kylo.tv


That is basically like Chrome or Firefox (it runs on a PC), just made to show better on your TV. So, no, sorry, that is very far away from TiVo's HME which Enter Webz uses. ;]


----------



## Fofer

Very cool! Nice work!

Is there any way to run this EnterWEBZ on a Mac OS system?


----------



## windracer

It's java, so it should work just fine. I got it running on Linux ...


----------



## davidblackledge

davidblackledge said:


> Today I'm announcing "Enter Webz" - the world's first web browser for the TiVo DVR.
> This is just a Beta release.
> 
> This release is available for download from http://David.Blackledge.com/tivo/enterwebz.
> More information is in the documentation.


Update is available for download
Major changes:

 Added hme: thumztak default for Reversi game; support TiVoConnect relative URLs.
 Better page formatting: implemented CSS Specificity rules, improved CSS inheritance.
 Update to JSoup 1.7.2 with more CSS selector support; (JSoup 1.7.3 may get my request allowing better decision on internal vs. TiVos Video Player for long videos.)
 First launch scripts for Linux, Mac. Added instructions for JAVA_HOME failure in Win.
 Better list bullets: middot character for disc type, degree character for circle, filled square character (unsupported by font, so shows as an unfilled rectangle) for square and # for all number/letter bullets.
 Improve display handling of back hint, backgrounds, image bullets, #section links
 Font size changed through Information Menu is saved. Font size changed with # buttons on page is temporary, 0 reverts to saved size.
 Added Maximize mode in Information Menu
 Added Left also works as Back mode (on by default) in Information Menu (more natural for TiVo, but annoying for mistakes)
 Added Password mode to hide text in TyPo keyboard; Fixed: text field direct entry with slide/USB keyboard didnt do capitals
 Rudimentary FRAME/IFRAME support (converts to links)
 Cookies for thumztaks are updated on quit (re-THUMB after login no longer needed)
 Bug fixes (includes: post-redirect URL wasnt used for relative content, forms with multiple same-named entries submit better)


----------



## jhilla

David you saved me again, yesturday the internal Youtube app went offline for maintenence or just went broke. i activated your batch file and was back in business in seconds. I can't wait to see how this new update stands out. I think I need to do some diggin to see about making it a service instead of running the batch. I've done it before, but lost the link that showed me how. I'll let you know if i find it.


----------



## davidblackledge

davidblackledge said:


> Update is available for download
> Major changes:
> 
> Added hme: thumztak default for Reversi game; support TiVoConnect relative URLs.
> Better page formatting: implemented CSS Specificity rules, improved CSS inheritance.
> Update to JSoup 1.7.2 with more CSS selector support; (JSoup 1.7.3 may get my request allowing better decision on internal vs. TiVos Video Player for long videos.)
> First launch scripts for Linux, Mac. Added instructions for JAVA_HOME failure in Win.
> Better list bullets: middot character for disc type, degree character for circle, filled square character (unsupported by font, so shows as an unfilled rectangle) for square and # for all number/letter bullets.
> Improve display handling of back hint, backgrounds, image bullets, #section links
> Font size changed through Information Menu is saved. Font size changed with # buttons on page is temporary, 0 reverts to saved size.
> Added Maximize mode in Information Menu
> Added Left also works as Back mode (on by default) in Information Menu (more natural for TiVo, but annoying for mistakes)
> Added Password mode to hide text in TyPo keyboard; Fixed: text field direct entry with slide/USB keyboard didnt do capitals
> Rudimentary FRAME/IFRAME support (converts to links)
> Cookies for thumztaks are updated on quit (re-THUMB after login no longer needed)
> Bug fixes (includes: post-redirect URL wasnt used for relative content, forms with multiple same-named entries submit better)


If you're a Linux or Mac user, please let me know if the launch script works from this newest version!

Thanks... getting closer to a full release and a public server! ;]
Let me know any must-haves!


----------



## Fofer

Cool, thanks! 

I tried the launch script ("Enter Webz.command?") on my Mac, running OS X 10.8.2 but got "Permission denied." Any help?


----------



## davidblackledge

Fofer said:


> I tried the launch script ("Enter Webz.command?") on my Mac, running OS X 10.8.2 but got "Permission denied." Any help?


Thanks for trying it. I think I know what the problem is and it probably has the same problem in Linux. The "execute" permissions have to be set on the scripts. I think I know how to fix that for the next release.

In the meantime, I don't have a mac, but I think the instructions you need to add "execute" permission to the script are here:
http://www.macinstruct.com/node/415
using the "File : Get Info" window or "chmod" on the command line.
Thanks again!


----------



## Allanon

Can you get this webpage to work better:

http://www.thefutoncritic.com/guide/what-new-shows-and-movies-are-coming-up/

It loads very slow and when I try to scroll it cause a blue screen error. I created a HME app that displays this page's information but if you are going to make a public server then I would like it to work so I can view the page even when my computer is off. Thanks!


----------



## davidblackledge

Allanon said:


> Can you get this webpage to work better:
> 
> http://www.thefutoncritic.com/guide/what-new-shows-and-movies-are-coming-up/
> 
> It loads very slow and when I try to scroll it cause a blue screen error.


This is a good example of a difficult page for Enter Webz... I've seen a few of them. 
On my TiVo, the screen goes pink and many UI parts disappear, and it can crash. Something about the web page results in Enter Webz using up all of the graphics memory or other HME limits and things kind of freak out. I think this is always going to be a problem. I intend to optimize to reduce the times this happens, and maybe I can find out what the limit is and track it so I handle the case before it freaks out.

In the meantime, it "fixed" it for me when I turned off "table layout" (in the "info" menu). (for me, the UI button colors were wrong because of the "freak out" until after this was done). This makes every table cell show up vertically with the rest of the page, reducing how much is on the screen at once.

It might alternatively improve things to use a larger font size - that would also reduce the amount of stuff on the screen at one time. I suspect this is mainly a problem with how many images are displayed at once, though.

I do see there is a lot of room for optimization in Enter Webz, so I suspect this page will start working as soon as I get some of that done.


----------



## Allanon

Have you considered rendering to an image and then just showing the image of the webpage on the Tivo? This would eliminate memory and resource issues. I did this a while back using HME for Python and the QtWebkit module that comes with PyQT. This makes the webpage look exactly like on a computer web browser. My webpage viewer updated the image every second for 640x480 and every 3 seconds for 1280x720. I was able to scroll but nothing else. I wanted to add other features but never got around to it.

Another method that works is rendering the full webpage to a bunch of images and string those images together when scrolling. This means the webpage is static but it is fast because you can just upload the images to the Tivo and just display and translate them when scrolling. You can still scroll through links using the position of the webpage elements and a little math. For sites like IMDB and the one I posted this is probably the best and easiest way to view the page.

BTW, I understand what you are doing is much more impressive than just rendering to an image but the Tivo only has a few resources and most webpages are going to use them up. What you might consider is keeping a list of resources on the computer and only rendering the resources that are currently visible on the Tivo screen. And removing or re-purposing resources as they leave the Tivo screen. This would limit the needed resources and probably increase loading speed.


----------



## davidblackledge

Allanon said:


> Have you considered rendering to an image and then just showing the image of the webpage on the Tivo? This would eliminate memory and resource issues.
> ...
> BTW, I understand what you are doing is much more impressive than just rendering to an image but the Tivo only has a few resources and most webpages are going to use them up. What you might consider is keeping a list of resources on the computer and only rendering the resources that are currently visible on the Tivo screen. And removing or re-purposing resources as they leave the Tivo screen. This would limit the needed resources and probably increase loading speed.


One of my main focuses is running on a remote server. As part of that, I want to minimize network traffic to the server and minimize processing on the server as much as possible. For instance, I want to make the TiVo do all the webpage image work by just giving it a URL... that's why all the large or unsupported images don't work - I have no intention of ever proxying those images through the server to fix them. I definitely don't want to do ALL the work on the server then do the ADDITIONAL work of doing an entire image transfer every few seconds.
I also didn't intend this to be a general web browser, just the uses I mentioned in the first post. That said, I want it to work as well as possible for valuable-for-viewing-on-TV pages like yours.

After Enter Webz builds the data structures it needs, it renders one row of text and images at a time until it hits the bottom of the screen. When you scroll, the rows slide up the screen and the ones that go off screen are completely freed, except for image stream resources in case they're used again on that page. Everything is freed when you hit "back"... but not when you go forward (although the version of Bananas I'm using does free up old pages after you go forward about 10, and I could change that number)

Resource issues do exist, though. I have to build an additional view for every text style change in the row, for every image, for every background color, and for every background image. I also have one view to contain each row, one to handle focus for each link, several for each form field, etc. 
I'm also using the Bananas toolkit to do the focus arrows which, I believe, adds a view for each arrow, for each focusable area... I could do something custom there.
I also want to consolidate consecutive rows that have the same formatting into a single large text-wrapped view. I could probably also consolidate link views... you've probably noticed that each change in formatting in the same link acts like a new link on the page.
Finally, according to the simulator, I'm creating views that I don't end up using in a number of places, so I need to find and squash those cases.

However, I suspect the major problems are
1) tables - necessarily more views at a time - basically treats a table cell as a new set of display rows, currently doesn't know how to stop rendering a table cell when it goes below the bottom of the screen - this is a major problem for some pages that put everything in a few giant table cells. Your page does this, too. Nested tables are an even bigger problem - my first attempts to handle that went badly. Instead it's sort of resetting when it hits a nested table.
2) too many views on screen at once... I believe 256 is the limit according to docs, but that was pre-HD docs - some limits have gone up, so maybe this did, too.
3) graphics memory limitations - http://tivohme.sourceforge.net/docs/hmesdk/04ProgrammingTechniques.html#wp1150653 may have changed in HD, too.
I'm probably violating several of these frequently. This is the hardest to get around and still render the page decently. It's also the harder one to check ahead of time.
4) repeating backgrounds - I'm currently stretching background images as a shortcut instead of repeating the same image over and over... in general that should save me a bunch of graphics issues, but I suspect that stretched images may take up extra memory or have some other dangerous side effects. They certainly cause major problems with the simulator, but the TiVo handles it better.

One thing I keep considering, however, is completely rewriting the rendering to use CSSBox - assuming I can get it to use JSoup for URL loading and my code to decide on Image and Font information per the TiVo box. It will figure out all the rendering using meta information and I could just render everything it says is in the current scrolled area, precisely how it would look in a real browser. 
It wouldn't fix all the resource problems, but it would simplify the rendering to majorly reduce the number of views, and it may make it easier to analyze the result for graphics limitation violations. Plus the layout would be better and would handle nested tables.


----------



## Allanon

davidblackledge said:


> One of my main focuses is running on a remote server. As part of that, I want to minimize network traffic to the server and minimize processing on the server as much as possible. For instance, I want to make the TiVo do all the webpage image work by just giving it a URL... that's why all the large or unsupported images don't work - I have no intention of ever proxying those images through the server to fix them. I definitely don't want to do ALL the work on the server then do the ADDITIONAL work of doing an entire image transfer every few seconds.


I could be wrong but doesn't an image still get downloaded to the server then uploaded to the Tivo if you just supply a URL for an image? Looking at the HME Python code it opens the image's file and sends the data to the Tivo not just the filename. Maybe Java HME is different?

Anyways I do see your point about trying to keep bandwidth at a minimum. But if my assumption about images being downloaded to the server is correct then just uploading 1-5 1280x720 images of a webpage might be less bandwidth than uploading 10-20 images that haven't been resized to fit the page, plus all the text and tables.


----------



## wmcbrine

Allanon said:


> I could be wrong but doesn't an image still get downloaded to the server then uploaded to the Tivo if you just supply a URL for an image? Looking at the HME Python code it opens the image's file and sends the data to the Tivo not just the filename.


You can specify an image as a Stream, as with audio and video. In that case the TiVo fetches it directly.



> _Maybe Java HME is different?
> _


Nope.


----------



## davidblackledge

What he said... ;]

That's also a major technical problem Enter Webz faces... I don't (yet) know a way to tell the TiVo "send these headers/cookies/referer to the website when you request the stream" - that's why so many images show up as errors - those websites refuse to send the stream if the request doesn't appear to come from the one who saw the HTML page.

I strongly believe it can be done with the "TeDict" parameters passed on stream creation, but haven't figured out the right format. *I'd love to have help on this.*

I tried sending somebody at TiVo this question out of desperation, but they didn't respond.


----------



## dadrepus

Changed permissions on my mac to 755 for file "Enter Webz.command. Tried to run file in terminal. Got this: dad$ /Applications/EnterWebzDist/Enter\ Webz.command ; exit;
-bash: /Applications/EnterWebzDist/Enter Webz.command: /bin/bash^M: bad interpreter: No such file or directory
logout
What did i do wrong? I just dragged the file into the terminal window to give me the path for the chmod. At least now it opens in terminal.


----------



## wmcbrine

dadrepus said:


> /bin/bash*^M*: bad interpreter: No such file or directory


DOS text file line endings on a Unix system.


----------



## dadrepus

wmcbrine said:


> DOS text file line endings on a Unix system.


Gee, what does that mean. You are talking to a relative novice. I know just enough to be dangerous. How do I fix it?


----------



## moyekj

dadrepus said:


> Gee, what does that mean. You are talking to a relative novice. I know just enough to be dangerous. How do I fix it?


 dos2unix command in unix will strip out the "DOS" eol characters.


----------



## dadrepus

moyekj said:


> dos2unix command in unix will strip out the "DOS" eol characters.


So how would i do that in terminal on a Mac I assume?
Do I do this? dos2unix /Applications/EnterWebzDist/Enter Webz.command

and then hit return?


----------



## dadrepus

I tried it and got: -bash: dos2unix: command not found


----------



## wmcbrine

Try this:

sudo nano "/Applications/EnterWebzDist/Enter Webz.command"

Then in the editor, type Ctrl-O, then Esc, then d, then Enter. Then Ctrl-X.


----------



## dadrepus

said warning" Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.


----------



## dadrepus

This is what I have now:dad$ /Applications/EnterWebzDist/Enter\ Webz.command ; exit;
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
LOG: added factory
LOG: added factory
MDNS: http://192.168.1.3:7288/webz/
MDNS: http://192.168.1.3:7288/webz1/
MDNS: http://192.168.1.3:7288/webz2/

YAHOO, or so I think. So, I go to check out the tv and this is what I see.

Archives.org/032videos/music/books
Enter \032webz
Google

YEA, so far so good...But when clicking on any of those links I get:
App Temporarily unavailable. The requested application is currently unavailable (v301) Please try again in a few minutes. For more info visit tiro.com/help/v301.

Anybody have a clue?


----------



## jhilla

My Java updated itself last night and now your app and Streambaby are disabled. I'm thinking I need to roll back Java and block updates for now. Anyone else run into this?


----------



## davidblackledge

First: Yay! I'm glad to hear the Mac .command file sort-of worked. I hope to have that "^M" problem taken care of in the next release.


dadrepus said:


> YEA, so far so good...But when clicking on any of those links I get:
> App Temporarily unavailable. The requested application is currently unavailable (v301) Please try again in a few minutes. For more info visit tiro.com/help/v301.
> 
> Anybody have a clue?


Hmm... Is it still doing that?
Does it say anything more in the window where you started it?

I've only seen that kind of error when Enter Webz poorly handled a page and crashed, but those first links "shouldn't" have such a problem, so something more serious must be going on... maybe there are other issues with the Mac version that I have to handle like maybe Enter Webz doesn't have permission to access one of its library files.


----------



## davidblackledge

jhilla said:


> My Java updated itself last night and now your app and Streambaby are disabled. I'm thinking I need to roll back Java and block updates for now. Anyone else run into this?


Just a guess: maybe Windows Firewall is blocking the new version from accessing the Internet? See if you can tell Windows Firewall to let Java do what it wants.
I just checked mine, and there were like 10 instances of Java listed, and only about half of them were allowed access to the Internet.


----------



## dadrepus

davidblackledge said:


> First: Yay! I'm glad to hear the Mac .command file sort-of worked. I hope to have that "^M" problem taken care of in the next release.
> 
> Hmm... Is it still doing that?
> Does it say anything more in the window where you started it?
> 
> I've only seen that kind of error when Enter Webz poorly handled a page and crashed, but those first links "shouldn't" have such a problem, so something more serious must be going on... maybe there are other issues with the Mac version that I have to handle like maybe Enter Webz doesn't have permission to access one of its library files.


Yes, nothing has changed.


----------



## dadrepus

This is what terminal says when I click on the command file:

/Applications/EnterWebzDist/Enter\ Webz.command ; exit;
DADS-COMPUTER-3:~ dad$ /Applications/EnterWebzDist/Enter\ Webz.command ; exit;
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
LOG: added factory
LOG: added factory
MDNS: http://192.168.1.3:7288/webz/
MDNS: http://192.168.1.3:7288/webz1/
MDNS: http://192.168.1.3:7288/webz2/


----------



## davidblackledge

dadrepus said:


> This is what terminal says when I click on the command file:
> 
> /Applications/EnterWebzDist/Enter\ Webz.command ; exit;
> DADS-COMPUTER-3:~ dad$ /Applications/EnterWebzDist/Enter\ Webz.command ; exit;
> HME SDK 1.4 (TiVo, Inc.)
> LOG: added factory
> LOG: added factory
> LOG: added factory
> MDNS: http://192.168.1.3:7288/webz/
> MDNS: http://192.168.1.3:7288/webz1/
> MDNS: http://192.168.1.3:7288/webz2/


...and nothing else shows up in the terminal after you try using it from the TiVo (and the TiVo gives an error)?


----------



## dadrepus

tried again and this is what is in terminal:

Last login: Sat Mar 23 15:26:31 on ttys002
You have mail.
/Applications/EnterWebzDist/Enter\ Webz.command ; exit;
DADS-COMPUTER-3:~ dad$ /Applications/EnterWebzDist/Enter\ Webz.command ; exit;
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
LOG: added factory
LOG: added factory
MDNS: http://192.168.1.3:7288/webz/
MDNS: http://192.168.1.3:7288/webz1/
MDNS: http://192.168.1.3:7288/webz2/
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.ExceptionInInitializerError
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
LOG: 192.168.1.7 bookmark.png HTTP GET - to factory /webz1/
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
LOG: 192.168.1.5 bookmark.png HTTP GET - to factory /webz1/


----------



## vucious

I have having a similar issue as dadrepus on a MAC. I get the following errors on my MAC console when trying to access Enter Webz from Tivo.

my-mac:EnterWebzDist-2013-2-5 vunguyen$ ./Webz.command 
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
LOG: added factory
LOG: added factory
...
...
LOG: null
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.ExceptionInInitializerError


----------



## davidblackledge

> HME SDK 1.4 (TiVo, Inc.)
> LOG: added factory
> LOG: added factory
> LOG: added factory
> MDNS: http://192.168.1.3:7288/webz/
> MDNS: http://192.168.1.3:7288/webz1/
> MDNS: http://192.168.1.3:7288/webz2/
> LOG: null
> LOG: unknown event opcode : 10
> LOG: connection to receiver closed
> LOG: Unexpected error: java.lang.ExceptionInInitializerError
> LOG: null
> LOG: unknown event opcode : 10
> LOG: connection to receiver closed
> LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
> LOG: 192.168.1.7 bookmark.png HTTP GET - to factory /webz1/


Ick. Very weird that it starts up OK, but has a problem with part of the application.
I couldn't find anything on he Internet specific to this happening on a Mac when it's working fine elsewhere.
My working theory is: HTMLBreakdown does a lot of work, but it includes the code to translate special characters from unicode that the TiVo can't display into ASCII equivalents. My Internet searches hinted at possible issues with Unicode differences on the Mac (probably depending on OS and Java version).

For the next release, I'll change how the unicode references are made in hopes that it helps, and I'll probably also move all of that translation code to a separate class and protect it so if that exception happens, Enter Webz doesn't break, it just doesn't do the translation (and you get a bunch of "squares" on the screen for complex characters).

Thanks for reporting this! Sorry that it might be a little while before I can do another release, though.

- David.


----------



## davidblackledge

davidblackledge said:


> PIP is off by default because of this. If PIP stops working...just turn it off and leave it off (maybe try again the next day if you like) - although it works some of the time, it's flakey. When it's working, turning it off then on (SLOW button) gets a blank PIP until you do it again. When it stops working (not scaled) consider everything destabilized until PIP is off - I've had it crash the TiVo for a simple error while the PIP was displaying in a bad state. There is work to do to find out how to cleanly make PIP work consistently like the Premiere does. (although that's through flash so it may not be completely possible in HME).


Just a note 1) to take up the last post on page 2 so my next update isn't the last post on the page again and 2) to let people know that I figured out the secret to scaling video consistently. I will use that for both Live TV PIP and optionally when you play videos in the browser (allowing you to continue browsing if you want).

The secret is: you can't put the view containing the video resource up against the top (and probably the left) edge of the screen, or it will ignore the scale factor and just try to display full screen. 
_Note the video can't move off the screen... it will stop at the edge even if the view moves past the edge - the video is still visible if there is no other resource/color displayed at that location._

FYI, I'm close to doing another release. Sometime in the next few weeks.


----------



## davidblackledge

moyekj said:


> The TiVo Roamio series that just launched has built in Opera web browser with HTML5 support. After some fussing around I discovered a way to display any arbitrary web page on my Roamio Plus.


DAMMIT!!


----------



## Fofer

davidblackledge said:


> DAMMIT!!


Your work here was _amazing_. In fact, there are probably users with older TiVos who would still be happy to see it, and use it, since that new built-in browser feature is a Roamio exclusive. Who knows, maybe that new feature will bring renewed attention to Enter Webz?!?!

I personally have little interest in a Roamio at this time... but would love to enhance my current Premiere with cool add-ons such as yours.

And I'm sure you learned a great deal developing Enter Webz. Kudos to you, and thanks. Keep your chin up! You're brilliant!


----------



## davidblackledge

​​​October Enter Webz Beta update - the Halloween Update!  (ok, there's nothing scary about this...unless you mean scary AWESOME!)

_Sorry about the 7 month lag. I was occupied with my wife's open-heart surgery & continuing recovery, and I have been playing a lot of Team Fortress 2 ;] (Pyro FTW!)_

​Download it from david.blackledge.com/tivo/enterwebz​

Major enhancements* (More detailed list is in the documentation)*:


Videos and Audio _play in-browser, PIP works so you can keep browsing, *much *better support in web pages._
RSS & Atom Feed support - _often a better option than the actual page_
More Images load now - _Facebook pictures and Gocomics.com work! Even Icanhascheezburger.com works! (RSS feed is better)_
​thumztak Organizing - _groups, order, editing_
Cookie improvements -_ lots of pages work better​, and "delete all cookies" to fix problems_
Fixed Mac and Linux issues _(hopefully)_
_Also: More fonts (serif, fixed, and script!), better navigation (mobile num shortcuts, "B"ack, Clear only quits), new UI graphics (still needs work), useful idle handling, fixed Live TV & many bugs, added new bugs ;]_

*​I want to emphasize the new RSS support. It is the better way to browse most content, providing a much simpler web page.* Archive.org has one for each category's recent uploads, futoncritic's covers half the site, and tivocommunity.com and most blogs and news sites have one. Note that RSS via feedburner (such as ICanHasCheezburger) now ignores their crazy stylesheet.

_My Next Goals: custom in-page focus manager and highlights, youtube playlists and on-the-fly audio/video playlists, complete main theme and theme system, edit thumztak url and icon, bigger list of useful compatible links, bug fixes... and a Public Server! (and some ads to pay for it)_ ​

Some known website issues:

Google services work fine... but later password verification can get stuck and you have to delete all cookies. The Google search page refuses to show the mobile version.
Yahoo services refuse to login with Enter Webz' Mobile mode, and logins aren't quite right in non-Mobile mode.​
Facebook videos don't show up - complain to Facebook. The same thing happens on my PalmOS phone's browser - they just don't send any HTML for the video at all!
While table layout was improved, the last column is still often broken, even a little worse now.
_Vimeo: home page will reboot your TiVo. I did a lot of work to support their videos, but they recently changed so now I can't support it at all._

Realistically, Enter Webz is better thought of as an App Platform for the TiVo. I've gathered some examples that use no scripting or plugins and are simple games, slideshows, and jukeboxes that work nicely. Targeting Enter Webz with a website design is much easier than writing an HME App.

*Please post your favorite websites/feeds/apps to view in Enter Webz so I can add them to my list!* I like http://m.podcast.tv and http://shoutcast.com not to mention http://m.facebook.com http://xkcd.com and http://gocomics.com

*And post your favorite sites and RSS feeds that don't quite work *so I can try to tackle bugs that might be in your way.


----------



## dadrepus

Just opened the Command file in terminal but other than this:
Last login: Wed Oct 30 22:10:05 on console
Alexs-Mac-mini:~ Alex$ /Applications/EnterWebzDist-2013-10-31/Enter\ Webz.command ; exit;
logout

[Process completed]
Nothing else happened. So I tried to directly open the jar file. (Now with Mavericks 10.9 one cannot easily open files by an unrecognized developer. One must hold down control button while clicking on an application or file) Well, the jar fails to open. Says go to console app to find error. Look at console but cannot find error so far. don't know exactly what the error would be called. I will continue to examine console for error. Glad your wife is doing better


----------



## davidblackledge

dadrepus said:


> Just opened the Command file in terminal but other than this:
> Last login: Wed Oct 30 22:10:05 on console
> Alexs-Mac-mini:~ Alex$ /Applications/EnterWebzDist-2013-10-31/Enter\ Webz.command ; exit;
> logout
> 
> [Process completed]
> Nothing else happened. So I tried to directly open the jar file. (Now with Mavericks 10.9 one cannot easily open files by an unrecognized developer. One must hold down control button while clicking on an application or file) Well, the jar fails to open. Says go to console app to find error. Look at console but cannot find error so far. don't know exactly what the error would be called. I will continue to examine console for error. Glad your wife is doing better


Ok, somebody send me a Mac and I'll test it ;]
Strange that the behavior seems so different. All I believe I did since last release is fix newlines in the command file and mark it as executable. 

Let me know if you find any output, (I'd hope relevant stuff would either mention "java" or "com.blackledge.david" etc. - the java package names) but otherwise we'll need a local Mac expert to get it working and enlighten us :/

Thanks for trying it!


----------



## davidblackledge

In the latest release of Enter Webz:

Video/PIP is handled with three features:
1) all video (including "livetv:") is currently handled by launching TiVo's VideoPlayer or Youtube Player app with detail parameters passed in. But it now does it via the "Application as Stream" feature. This is broken in the Java SDK, but easily worked around (see the wiki).
(in the future I should put "livetv:" in a custom handler so you don't have to wait for the VideoPlayer app to launch)
2) Scaling, like I mentioned previously, is handled with a setting the View's scale and position, but the position has to NOT be up against the upper and left edges of the screen or the scale is ignored by the video stream (and destabilizes I think)
3) Most interesting: I finally realized what the Send Event command is REALLY for (not just for animation chaining per the SDK documentation). It actually sends the event to the targeted Stream... if that stream is an Application, then it's like you hit that remote button. For my purposes, when the player is full screen, I forward every event except for two that I want to override (Zoom/Aspect/Window/PIP and Left - both of which scale/position to PIP mode). When it's in PIP mode I only forward the Pause button.


Images: I guess all https resource URLs are mishandled by the TiVo, so that caused lots of images to fail in webpages... instead I just replace them all with http URLs and hope for the best. Usually it works. (there is a bug in this release where my "figure out the size" code isn't handling the replaced URLs correctly - fixed in next release). There are still lots of sites that protect against remote loading, and I haven't gotten a solution for telling the TiVo to send referer/cookie information in its request.


Fonts: I found some freely distributable fonts that fit the bill and put them on my main website, then just tell the TiVo to download the font from there when I need it, and re-use the font resource for the rest of the session.


----------



## wmcbrine

davidblackledge said:


> 1) all video (including "livetv:") is currently handled by launching TiVo's VideoPlayer or Youtube Player app with detail parameters passed in. But it now does it via the "Application as Stream" feature. This is broken in the Java SDK, but easily worked around (see the wiki).


Interesting. Uh, where _exactly_ in the wiki?


----------



## davidblackledge

wmcbrine said:


> Interesting. Uh, where _exactly_ in the wiki?


ok, the wiki's not that well organized.

SDKs > Java SDK Bugs / Gotchas
http://hmedev.wikidot.com/java-sdk-bugs-gotchas
The last entry (parseQuery)

That's specifically a bug in the Java SDK code itself.

Actually, I'll soon stick on the wiki the three classes I put together to encapsulate all I could of the V49 changes for the Java SDK and to make using the 1.4.1e version of the SDK easier.

Let's see if I can get them into this post:
V49IHmeProtocol.java - just the additional constants for the keyboard and video status, etc.
V49BApplicationFactory.java - report your app as V49 so you can use new features
V49BApplication.java - helpers for several V49 features, and fixes for some problems (some are pre 1.4.1e problems that don't need fixing if you use the newer SDK, so I made them forward compatible fixes).

Code:
V49IHmeProtocol.java


Code:


package com.blackledge.david.tivo;

import com.tivo.hme.interfaces.IHmeConstants;
import com.tivo.hme.sdk.IHmeProtocol;

/**
 * IHmeProtocol extension that supports some features beyond SDK 1.4.1
 * especially HTTP Header strings and Slide Remote key codes. Typically just use
 * {@link #KEY_OPT_ASCII_START}, {@link #KEY_OPT_ASCII_END}, and
 * {@link #KEY_OPT_ASCII_OFFSET} to get all the characters.
 * 
 */
public interface V49IHmeProtocol extends IHmeProtocol {
	/**
	 * 0.49 - Slide Remote key events supported (no "supporting" sdk version)
	 * (0.41 ({@link IHmeProtocol#VERSION_0_41}) supported by sdk 1.4, 0.43-0.45
	 * ({@link IHmeProtocol#VERSION_0_43}-{@link IHmeProtocol#VERSION_0_45}) by
	 * sdk 1.4.1e)
	 */
	public static final int VERSION_0_49 = (0 << 8) | 49;

	/**
	 * according to an error logged:
	 * "rendered text exceeded max allowed dimensions of 1920x1080"
	 */
	public static final int LIMIT_TEXT_RENDER_WIDTH = 1920;
	/**
	 * according to an error logged:
	 * "rendered text exceeded max allowed dimensions of 1920x1080"
	 */
	public static final int LIMIT_TEXT_RENDER_HEIGHT = 1080;
	
	/** Media status code, resource at end of stream. */
	public static final int RSRC_STATUS_END = 11;
	/** Media status code, resource at end of available buffer. */
	public static final int RSRC_STATUS_BUFFER_OVERFLOW = 12;
	
    /**
	 * Zoom key, optional, relabel of {@link #KEY_OPT_ASPECT} key, which is same
	 * code as {@link #KEY_OPT_WINDOW} and {@link #KEY_OPT_PIP} (22).
	 */
    public static final int KEY_OPT_ZOOM			= KEY_OPT_WINDOW;
    
    // undefined keys in SDK: 0-21, 23, 25, 28-50
    
    /**
	 * On Demand key, reserved for internal use. E.g. long blue ON DEMAND button
	 * on Charter remote. This is sent in a key press event just before
	 * attempting to "teleport" to the service. In anything below Series 4, no
	 * teleport and not transmitted over HME, apparently.
	 */
    public static final int KEY_OPT_ON_DEMAND = 30;
    
    // last SDK key code defined: KEY_OPT_DVD = 55;
    
	/**
	 * "A" yellow remote button, may only transmit on if identified as V49.
	 */
	public static final int KEY_OPT_A_YELLOW = 56;
	/**
	 * "B" blue remote button, may only transmit on if identified as V49.
	 */
	public static final int KEY_OPT_B_BLUE = 57;
	/**
	 * "C" red remote button, may only transmit on if identified as V49.
	 */
	public static final int KEY_OPT_C_RED = 58;
	/**
	 * "D" green remote button, may only transmit on if identified as V49.
	 */
	public static final int KEY_OPT_D_GREEN = 59;
	
	/**
	 * Backspace (picture of a left arrow on slide remote) button code.<BR>
	 */
	public static final int KEY_OPT_BACKSPACE = 65;
	
	// codes 60-64 and 66-69 are unknown, currently
	
	/**
	 * code returned by the RETURN key on the keyboard if it is
	 * modified by Alt (or Windows or Ctrl (or possibly "sym"(bol))). Normally
	 * that key sends KEY_SELECT.
	 */
	public static final int KEY_OPT_ALT_SELECT = 70;
	/**
	 * Left Shift button code. You do not need to process this to handle
	 * capitalization, use KEY_OPT_ASCII_* to get the properly capitalized
	 * character.
	 */
	public static final int KEY_OPT_LEFT_SHIFT = 71;
	/**
	 * Right Shift button code. You do not need to process this to handle
	 * capitalization, use KEY_OPT_ASCII_* to get the properly capitalized
	 * character.
	 */
	public static final int KEY_OPT_RIGHT_SHIFT = 72;
	/**
	 * Left Alt (and Windows) key button code for keyboards - POSSIBLY the
	 * "sym"(bol) key for the Slide Remote (although there is only one, on the
	 * right side). You do not need to process this to handle symbols, use
	 * KEY_OPT_ASCII_* to get the properly capitalized character.
	 */
	public static final int KEY_OPT_LEFT_ALT = 73;
	/**
	 * Right Alt (and Windows) key button code for keyboards - POSSIBLY the
	 * "sym"(bol) key for the Slide Remote. You do not need to process this to
	 * handle symbols, use KEY_OPT_ASCII_* to get the properly capitalized
	 * character.
	 */
	public static final int KEY_OPT_RIGHT_ALT = 74;
	/**
	 * Capslock button code. You do not need to process this to handle
	 * capitalization, use KEY_OPT_ASCII_* to get the properly capitalized
	 * character.
	 */
	public static final int KEY_OPT_CAPSLOCK = 75;
	
	/**
	 * For all characters between KEY_OPT_ASCII_START and KEY_OPT_ASCII_END
	 * (inclusive) subtract this value from the key code to get the ASCII
	 * character they represent.
	 */
	public static final int KEY_OPT_ASCII_OFFSET = 65536; // 2^16
	public static final int KEY_OPT_ASCII_SPACE = KEY_OPT_ASCII_OFFSET+' ';
	// Sym Q
	public static final int KEY_OPT_ASCII_EXCLAMATION = KEY_OPT_ASCII_OFFSET+'!';
	// Sym L
	public static final int KEY_OPT_ASCII_QUOTE = KEY_OPT_ASCII_OFFSET+'\"';
	// Sym E
	public static final int KEY_OPT_ASCII_HASH = KEY_OPT_ASCII_OFFSET+'#';
	// Sym R
	public static final int KEY_OPT_ASCII_DOLLAR = KEY_OPT_ASCII_OFFSET+'$';
	// Sym T
	public static final int KEY_OPT_ASCII_PERCENT = KEY_OPT_ASCII_OFFSET+'%';
	// Sym U
	public static final int KEY_OPT_ASCII_AMPERSAND = KEY_OPT_ASCII_OFFSET+'&';
	// Sym K
	public static final int KEY_OPT_ASCII_APOSTROPHE = KEY_OPT_ASCII_OFFSET+'\'';
	// Sym O
	public static final int KEY_OPT_ASCII_LEFTPAREN = KEY_OPT_ASCII_OFFSET+'(';
	// Sym P
	public static final int KEY_OPT_ASCII_RIGHTPAREN = KEY_OPT_ASCII_OFFSET+')';
	// Sym I
	public static final int KEY_OPT_ASCII_ASTERISK = KEY_OPT_ASCII_OFFSET+'*';
	// Sym 1
	public static final int KEY_OPT_ASCII_PLUS = KEY_OPT_ASCII_OFFSET+'+';
	// Sym B
	public static final int KEY_OPT_ASCII_COMMA = KEY_OPT_ASCII_OFFSET+',';
	// Sym 2
	public static final int KEY_OPT_ASCII_MINUS = KEY_OPT_ASCII_OFFSET+'-';
	// Sym N
	public static final int KEY_OPT_ASCII_PERIOD = KEY_OPT_ASCII_OFFSET+'.';
	// Sym 5
	public static final int KEY_OPT_ASCII_SLASH = KEY_OPT_ASCII_OFFSET+'/';
	// 0-9 use KEY_NUM0-KEY_NUM9
	// Sym J
	public static final int KEY_OPT_ASCII_COLON = KEY_OPT_ASCII_OFFSET+':';
	// Sym H
	public static final int KEY_OPT_ASCII_SEMICOLON = KEY_OPT_ASCII_OFFSET+';';
	// Sym Z
	public static final int KEY_OPT_ASCII_LESS = KEY_OPT_ASCII_OFFSET+'<';
	// Sym 3
	public static final int KEY_OPT_ASCII_EQUAL = KEY_OPT_ASCII_OFFSET+'=';
	// Sym X
	public static final int KEY_OPT_ASCII_GREATER = KEY_OPT_ASCII_OFFSET+'>';
	// Sym M
	public static final int KEY_OPT_ASCII_QUESTION = KEY_OPT_ASCII_OFFSET+'?';
	// Sym W
	public static final int KEY_OPT_ASCII_AT = KEY_OPT_ASCII_OFFSET+'@';
	public static final int KEY_OPT_ASCII_A_UPPER = KEY_OPT_ASCII_OFFSET+'A';
	public static final int KEY_OPT_ASCII_Z_UPPER = KEY_OPT_ASCII_OFFSET+'Z';
	// Sym F
	public static final int KEY_OPT_ASCII_LEFTBRACKET = KEY_OPT_ASCII_OFFSET+'[';
	// Sym V
	public static final int KEY_OPT_ASCII_BACKSLASH = KEY_OPT_ASCII_OFFSET+'\\';
	// Sym G
	public static final int KEY_OPT_ASCII_RIGHTBRACKET = KEY_OPT_ASCII_OFFSET+']';
	// Sym Y
	public static final int KEY_OPT_ASCII_CIRCUMFLEX = KEY_OPT_ASCII_OFFSET+'^';
	// Sym 7
	public static final int KEY_OPT_ASCII_UNDERSCORE = KEY_OPT_ASCII_OFFSET+'_';
	// Sym 9
	public static final int KEY_OPT_ASCII_GRAVE = KEY_OPT_ASCII_OFFSET+'`';
	public static final int KEY_OPT_ASCII_A_LOWER = KEY_OPT_ASCII_OFFSET+'a';
	public static final int KEY_OPT_ASCII_Z_LOWER = KEY_OPT_ASCII_OFFSET+'z';
	// Sym S
	public static final int KEY_OPT_ASCII_LEFTBRACE = KEY_OPT_ASCII_OFFSET+'{';
	// Sym C
	public static final int KEY_OPT_ASCII_BAR = KEY_OPT_ASCII_OFFSET+'|';
	// Sym D
	public static final int KEY_OPT_ASCII_RIGHTBRACE = KEY_OPT_ASCII_OFFSET+'}';
	// Sym A
	public static final int KEY_OPT_ASCII_TILDE = KEY_OPT_ASCII_OFFSET+'~';
	/**
	 * space character - beginning of range of values that are ASCII characters
	 * plus KEY_OPT_ASCII_OFFSET. Note that 0-9 do not show up this way,
	 * instead sending the KEY_NUM* codes.
	 */
	public static final int KEY_OPT_ASCII_START = KEY_OPT_ASCII_SPACE;
	/**
	 * tilde character - end of range of values that are ASCII characters plus
	 * KEY_OPT_ASCII_OFFSET. Note that 0-9 do not show up this way,
	 * instead sending the KEY_NUM* codes.
	 */
	public static final int KEY_OPT_ASCII_END = KEY_OPT_ASCII_TILDE;

	// as discovered by davidblackledge - Premiere only.
	public static final int ID_FONT3_TTF = 13;
	public static final int ID_FONT3ITALIC_TTF = 14;
	public static final int ID_FONT3BOLD_TTF = 15;
	// as discovered by wmcbrine - Premiere only
	public static final int ID_SPEEDUP4_SOUND = 37;
	
	/**
	 * HTTP Header sent in resource requests by the TiVo with the tsn (context
	 * connection attribute "tsn") as value.
	 */
	public static final String HTTP_HEADER_TIVO_ID = "TiVo_TCD_ID";

	/**
	 * HTTP Header sent in resource requests by the TiVo with the TiVo Software
	 * Version (Device Info event's "version") as value.
	 */
	public static final String HTTP_HEADER_TIVO_VERSION = "TiVo_SW_VER";

	public static final String HTTP_HEADER_TIVO_DURATION = IHmeConstants.TIVO_DURATION;

}

V49BApplication.java


Code:


package com.blackledge.david.tivo;

import java.awt.Rectangle;
import java.io.UnsupportedEncodingException;
import java.lang.ref.WeakReference;
import java.net.URLDecoder;
import java.util.Map;
import java.util.LinkedHashMap;

import com.tivo.hme.bananas.BApplication;
import com.tivo.hme.interfaces.IContext;
import com.tivo.hme.sdk.Application;
import com.tivo.hme.sdk.HmeEvent;
import com.tivo.hme.sdk.HmeEvent.DeviceInfo;
import com.tivo.hme.sdk.IHmeProtocol;
import com.tivo.hme.sdk.Resource;
import com.tivo.hme.sdk.Version;

/**
 * BApplication that fixes SDK bugs, supports some features beyond SDK 1.4.1 and
 * makes some things easier. See {@link V49BApplicationFactory} and
 * {@link V49IHmeProtocol} for other features.
 * <UL>
 * <LI>Use {@link V49BApplicationFactory} as superclass for your factory to tell the TiVo you're using V49 (or another version).
 * <LI>Constants for SDK resource strings *.ttf, *.snd
 * <LI>Constants for discovered Stream resources "livetv:" "loopset:" and
 * "recording:"
 * <LI>Getters for spacing when a "loopset:" is the background
 * <LI>Member variables for protocol version, tivo version, and tivo ID.
 * <LI>Resolution help: automatically set preferred resolution, template methods
 * for init and showing the first BScreen during resolution setting
 * <LI>Template method for cleaning up during {@link #destroy()} to prevent an
 * SDK 1.4 bug (not an issue in 1.4.1e)
 * <LI>Post Resource errors to the resource and with new version of
 * {@link #handleApplicationError(int, String, Integer)}
 * <LI>Fix SDK bug that broke Application-as-stream feature.
 * <LI>Support more TTF built-in fonts with new constant names for series-4-only
 * fonts, and with id numbers-as-font-names for arbitrary attempts.
 * <LI>SDK capability/version methods.
 * <LI>Backward compatibility of new SDK methods to old SDK. You should be able
 * to run this app in either SDK.
 * </UL>
 * 
 * @author David.Blackledge.com
 * 
 */
public abstract class V49BApplication extends BApplication implements V49IHmeProtocol {

    public static final String TTF_SERIES4FONT3BOLD = "series4font3bold.ttf";
	public static final String TTF_SERIES4FONTITALIC = "series4fontitalic.ttf";
	public static final String TTF_SERIES4FONT = "series4font.ttf";
	public static final String TTF_DEFAULT = "default.ttf"; //$NON-NLS-1$
    public static final String TTF_SYSTEM = "system.ttf"; //$NON-NLS-1$
    
    public static final String SOUND_BONK = "bonk.snd"; //$NON-NLS-1$
    public static final String SOUND_UPDOWN = "updown.snd"; //$NON-NLS-1$
    public static final String SOUND_THUMBSUP = "thumbsup.snd"; //$NON-NLS-1$
    public static final String SOUND_THUMBSDOWN = "thumbsdown.snd"; //$NON-NLS-1$
    public static final String SOUND_SELECT = "select.snd"; //$NON-NLS-1$
    public static final String SOUND_TIVO = "tivo.snd"; //$NON-NLS-1$
    public static final String SOUND_LEFT = "left.snd"; //$NON-NLS-1$
    public static final String SOUND_RIGHT = "right.snd"; //$NON-NLS-1$
    public static final String SOUND_PAGEUP = "pageup.snd"; //$NON-NLS-1$
    public static final String SOUND_PAGEDOWN = "pagedown.snd"; //$NON-NLS-1$
    public static final String SOUND_ALERT = "alert.snd"; //$NON-NLS-1$
    public static final String SOUND_DESELECT = "deselect.snd"; //$NON-NLS-1$
    public static final String SOUND_ERROR = "error.snd"; //$NON-NLS-1$
    public static final String SOUND_SLOWDOWN1 = "slowdown1.snd"; //$NON-NLS-1$
    public static final String SOUND_SPEEDUP1 = "speedup1.snd"; //$NON-NLS-1$
    public static final String SOUND_SPEEDUP2 = "speedup2.snd"; //$NON-NLS-1$
    public static final String SOUND_SPEEDUP3 = "speedup3.snd"; //$NON-NLS-1$
    
	public static final String STREAM_LIVETV = "livetv:"; //$NON-NLS-1$
	public static final String STREAM_LOOP_RED_CENTRAL = "loopset:Central"; //$NON-NLS-1$
	public static final String STREAM_LOOP_PURPLE_SHOWCASES = "loopset:Showcases"; //$NON-NLS-1$
	public static final String STREAM_LOOP_BLUE_SETUP = "loopset:Setup"; //$NON-NLS-1$
	public static final String STREAM_LOOP_GREEN_NOWPLAYING = "loopset:NowPlaying"; //$NON-NLS-1$
	public static final String STREAM_RECORDING_PREFIX = "recording:"; //$NON-NLS-1$
	
    
	/**
	 * Protocol in use between the TiVo and the server. Used in methods like
	 * {@link #isSlideRemoteSupported()}. Accurate/dynamic version of
	 * {@link IHmeProtocol#VERSION}. Saved during
	 * {@link #setContext(IContext, int)} call. Use V49BapplicationFactory as
	 * your factory's supertype to register V49 as your preferred protocol
	 * version.
	 */
	public int protocolVersion;
	/**
	 * Device Info event's "version" - the TiVo's Software Version. E.g.
	 * 11.0k-01-2-652 . Available after DEVICE_INFO_EVENT comes in.
	 */
	protected String tivoVersion;
	/**
	 * The TiVo Service Number (tsn) uniquely identifying the connected TiVo DVR
	 * device. Available after {@link #setContext(IContext, int)} is called.
	 */
	protected String tivoID;

	/**
	 * Does nothing.  Override this to output debug messages
	 * @param message
	 */
	public void debug(String message) {
	}

	/**
	 * Template method to do {@link #init(IContext)} tasks between super's init
	 * and preferred resolution setting. Better to override this than init
	 * unless you want to handle setting resolution yourself.
	 */
	protected void initBeforeResolutionSet(IContext context) {
	}

	/**
	 * Template method to do {@link #rootBoundsChanged(Rectangle)} tasks between
	 * super's rootBoundsChanged and a possible call to {@link #showFirstPage()}
	 * if this is the first root bounds change during application
	 * initialization. Override this, or it might be OK to override
	 * rootBoundsChanged and just call its super method and ignore this.
	 * 
	 * @param rootBounds
	 */
	protected void rootBoundsChangedBeforeFirstPage(Rectangle rootBounds) {
	}

	/**
	 * Override this to push the first BScreen of the application after
	 * resolution issues are resolved.
	 */
	protected abstract void showFirstPage();

	/**
	 * Override this instead of {@link #destroy()} for SDK 1.4 to do safe cleanup during the
	 * destroy operation. Prevents the loop that occurs if a fatal error happens
	 * during destroy.  Not an issue in 1.4.1e
	 */
	protected void destroyCleanup() {
	}
	
	
	/* BEGIN fix JDK */
	

	// TODO future: handle unsupported chunks (e.g. Event 10)
	// public boolean handleChunk(InputStream in)
	// {
	// synchronized (lock) {
	// //debug("handleChunk()");
	// boolean doMore = true;
	//
	// // flush any data that was generated from previous handling of
	// // event
	// flush();
	//
	// ChunkedInputStream chunkInStr = null;
	// if (in instanceof ChunkedInputStream)
	// {
	// chunkInStr = (ChunkedInputStream)in;
	// }
	// else
	// {
	// chunkInStr = new ChunkedInputStream(in); //,
	// IHmeConstants.TCP_BUFFER_SIZE);
	// }
	//
	// // if ( protocolVersion < VERSION_0_40 )
	// // {
	// // chunkInStr.setUseVString( false );
	// // }
	// // else {
	// chunkInStr.setUseVString( true );
	// // }
	//
	// int opcode = -1;
	// try {
	// opcode = (int)chunkInStr.readVInt();
	// } catch (IOException e) {
	// // receiver closed - ignore
	// // if (debug()) {
	// // log(ILogger.LOG_DEBUG,
	// // "Connection terminated by receiver");
	// // }
	// }
	// if (opcode == -1) {
	// doMore = false;
	// return doMore;
	// }
	//
	// HmeEvent evt = null;
	// String eventString = null;
	// try
	// {
	// switch (opcode) {
	// case EVT_DEVICE_INFO:
	// evt = new HmeEvent.DeviceInfo(chunkInStr);
	// break;
	// case EVT_APP_INFO:
	// evt = new HmeEvent.ApplicationInfo(chunkInStr);
	// break;
	// case EVT_RSRC_INFO:
	// evt = new HmeEvent.ResourceInfo(chunkInStr, this);
	// break;
	// case EVT_RESOLUTION_INFO:
	// evt = new HmeEvent.ResolutionInfo(chunkInStr);
	// break;
	// case EVT_KEY:
	// evt = new HmeEvent.Key(chunkInStr);
	// break;
	// case EVT_IDLE:
	// evt = new HmeEvent.Idle(chunkInStr);
	// break;
	// case EVT_FONT_INFO:
	// evt = new HmeEvent.FontInfo(chunkInStr);
	// break;
	// case EVT_INIT_INFO:
	// evt = new HmeEvent.InitInfo(chunkInStr);
	// break;
	// default:
	// eventString =
	// "HmeEvent[opcode=" + opcode
	// + ", id = " + chunkInStr.readVInt()
	// + "]";
	// // short clen = chunkInStr.readShort();
	// // while (clen != 0) {
	// // System.out.println(clen);
	// // chunkInStr.skip(clen);
	// // clen = chunkInStr.readShort();
	// // }
	//
	// // System.out.println(eventString);
	// // try {
	// // System.out.println(chunkInStr.readInt());
	// // System.out.println(chunkInStr.readDict());
	// // } catch(IOException e1) {
	// // chunkInStr.readTerminator();
	// // throw e1;
	// // }
	// break;
	// }
	// if (evt != null) {
	// evt.setMonitor(lock);
	// }
	// chunkInStr.readTerminator();
	// }
	// catch (IOException e) {
	// evt = null;
	// getLogger().log(ILogger.LOG_INFO, e);
	// }
	//
	// //
	// // Save the event, in case we need to dump the list
	// //
	// // if (eventsReceived != null) {
	// // if (eventsReceived.size() >= MAX_RECEIVED_EVENTS_SIZE) {
	// // // Startup is complete -- stop checking for protocol errs
	// // startupComplete = true;
	// // eventsReceived.clear();
	// // eventsReceived = null;
	// // } else {
	// // if (evt != null) {
	// // eventString = evt.toString();
	// // }
	// // if (eventString == null) {
	// // eventString = "Bad HmeEvent[opcode="+opcode+", no ID]";
	// // }
	// // eventsReceived.add(eventString);
	// // }
	// // }
	//
	// if (evt == null) {
	// getLogger().log(ILogger.LOG_DEBUG,
	// "unknown event opcode : " + opcode);
	// }
	// else
	// {
	// // if any debugging is turned on, verify the event is kosher
	// // if (debug()) {
	// // evt.verify(logger);
	// // }
	//
	// // debugEvents means to print each and every event received
	// // if (debugEvents()) {
	// getLogger().log(ILogger.LOG_DEBUG, "event " + evt);
	// // }
	//
	// // if (!preprocessEvent(evt)) {
	// //
	// // // preprocessEvent() says this event should be discarded
	// // if (eventsReceived != null) {
	// // int i = eventsReceived.size() - 1;
	// // eventsReceived.set(i,
	// // eventsReceived.get(i).toString() + " [IGNORED]");
	// // }
	//
	// // } else {
	//
	// // The app should receive this event.
	// //
	// // Only dispatch events after app.init() is called.
	// // Save events before init(), to be dispatched later.
	// //
	// // if (appInitialized) {
	// // dispatchEvent(evt);
	// // } else if (queuedEvents != null) {
	// // // Save the events to send after initialization
	// // queuedEvents.add(evt);
	// // }
	// // }
	// }
	//
	// // flush any data that was generated from handling of event
	// flush();
	//
	// return doMore;
	// } // sync
	//
	// } // handleChunk()


	/**
	 * unfortunately sdk's Resource.ResourceStatus isn't public, so we recreate
	 * it here - all it does is use a different Event ID
	 */
	protected static class MockResourceStatus extends HmeEvent.ResourceInfo {
		MockResourceStatus(int id, Resource rsrc, int status, Map map) {
			super(EVT_RSRC_STATUS, id, rsrc, status, map);
		}

		public String toString() {
			return getID() + ".RSRC_STATUS(" + statusToString(getStatus()) //$NON-NLS-1$
					+ ")"; //$NON-NLS-1$
		}
	}

	private boolean destroyedAlready = false;

	public void destroy() {
		// protect against SDK 1.4 bug: if there is a fatal error during below
		// operations (e.g. remove operations) close gets called which calls
		// destroy again.
	
		// what happens: after the 2nd call to here, we'll get HMEException from
		// the remove call that caused it which contains the actual cause
		// (unless it was originally an HMEException)
		// setId(-1) has not been called on the object yet
	
		// SO: want to catch HMEExceptions if we want to finish our destroy
		// operation
		if (destroyedAlready)
			return;
		destroyedAlready = true;
	
		// template method
		destroyCleanup();
		// ... operations that could cause a fatal error, e.g. "remove" calls
	
		super.destroy(); // in case e.g. BApplication ever starts doing
							// something there.
	}
	
	/**
	 * Improved version of
	 * {@link Application#handleApplicationError(int, String)} that includes the
	 * resourceId related to the error - critical for knowing when you have a
	 * problem with a resource you created. Default implementation simply calls
	 * {@link #handleApplicationError(int, String)}. ApplicationError codes 1
	 * (e.g. "can't create rsrc. unsupported stream type
	 * /avatar/cf1e61a4330e75d5d1d7a744c5ef38c4") and 3 (e.g. "resource 2091 not
	 * found (type type[-1])") about a resource never provide a resourceinfo
	 * event!
	 * 
	 * @param errorCode
	 *            the error code of the error (one of the {@link IHmeProtocol}
	 *            APP_ERROR_ constants)
	 * @param errorText
	 *            details of the error
	 * @param resourceId
	 *            the id associated with the error - could be null. Suitable for
	 *            use with {@link #getResource(Object)} (or ((WeakReference)
	 *            {@link #getResources()}.get(Object)).get() to avoid automatic
	 *            SDK warning message when it's not found)
	 * @return true if the event was handled.
	 */
	public boolean handleApplicationError(int errorCode, String errorText, Integer resourceId) {
		if (handleApplicationError(errorCode, errorText)) {
			return true;
		} else {
			// FIXME add processing needed by e.g. image exceeding max width or
			// height (errorCode 2) with no resource id
			return false;
		}
	}

	/**
	 * Perform some common handling - be sure to call this from subclasses that
	 * override it. Sets {@link #tivoVersion} from DEVICE_INFO. Improves error
	 * handling by posting resource errors to the resource itself, and calling
	 * {@link #handleApplicationError(int, String, Integer)}, passing in
	 * resource ID.
	 * 
	 */
	public boolean handleEvent(HmeEvent event) {
		// get tivo version from device info
		if (event.getOpCode() == EVT_DEVICE_INFO) {
			HmeEvent.DeviceInfo info = (DeviceInfo) event;
			this.tivoVersion = (String) info.getMap().get("version"); //$NON-NLS-1$
			// com.tivo.examine.idType.stationId=tivo,
			// platform=Gen06,
			// host=Bedroom,
			// brand=TiVo,
			// com.tivo.examine.showing=true,
			// com.tivo.examine.idType.contentId=tivo,
			// version=11.0k-01-2-652
		}
	
		// ...
		if (event.getOpCode() == EVT_APP_INFO) {
			HmeEvent.ApplicationInfo info = (HmeEvent.ApplicationInfo) event;
			if (info.getMap().get("error.code") != null) { //$NON-NLS-1$
				int errorCode = Integer.parseInt((String) info.getMap().get(
						"error.code")); //$NON-NLS-1$
				Integer resourceId = null;
				if (info.getMap().get("error.rsrc") != null) { //$NON-NLS-1$
					try {
						resourceId = new Integer((String) info.getMap().get(
								"error.rsrc")); //$NON-NLS-1$
					} catch (NumberFormatException e) {
						resourceId = null;
					}
				}
				String errorText = (String) info.getMap().get("error.text"); //$NON-NLS-1$
				if (resourceId != null) {
					WeakReference res_wr = (WeakReference) getResources().get(
							resourceId);
					if (res_wr != null && res_wr.get() != null) {
						Resource res = (Resource) res_wr.get();
						Map resInfoMap = info.getMap();
						// TODO we're doing this regardless of whether it's
						// actually a change in status
						if (res.status == Resource.RSRC_STATUS_ERROR) {
							debug("NOTE: had to send ResourceStatus event for error even though resource's status was already error."); //$NON-NLS-1$
						}
						debug("Posting APP_INFO resource error to resource " //$NON-NLS-1$
								+ resourceId + ": " + resInfoMap); //$NON-NLS-1$
						res.postEvent(new MockResourceStatus(resourceId
								.intValue(), res, Resource.RSRC_STATUS_ERROR,
								resInfoMap));
					}
				} else
					debug("APP_INFO error " + errorCode + ": " + errorText); //$NON-NLS-1$ //$NON-NLS-2$
	
				return handleApplicationError(errorCode, errorText, resourceId);
			}
		}
	
		boolean result = super.handleEvent(event);
		// ...
	
		return result;
	}

	/**
	 * SDK Bug Fix - OMG! sick bug in HMEObject that has never been noticed or
	 * exercised since nobody has apparently attempted to do App-in-app with
	 * {@link #createStream(String, Map)}. They forgot a "new" keyword and
	 * auto-"fixed" the problem creating a method named LinkedHashMap that has
	 * default method content returning null! Also, calling code won't handle
	 * the nulls that are returned in certain circumstances, so now returning an
	 * empty map here. Lucky for us it is public and non-final. {@inheritDoc}
	 * 
	 * @see com.tivo.hme.sdk.HmeObject#parseQuery(java.lang.String)
	 */
	public Map parseQuery(String query) {
		Map map = new LinkedHashMap();
		if (query == null || query.indexOf('=') == -1) {
			return map;
		}
	
		int at = 0;
		int len = query.length();
	
		if (query.startsWith("?")) { //$NON-NLS-1$
			++at;
		}
		do {
			// find = and &
			int equal = query.indexOf('=', at);
			if (equal < 0) {
				throw new IllegalArgumentException(
						"invalid query (trailing key, = not found)"); //$NON-NLS-1$
			}
			int amp = query.indexOf('&', equal);
			if (amp == -1) {
				amp = query.length();
			}
	
			// add the key/value
			try {
				String key = URLDecoder.decode(query.substring(at, equal),
						"UTF-8"); //$NON-NLS-1$
				String value = URLDecoder.decode(
						query.substring(equal + 1, amp), "UTF-8"); //$NON-NLS-1$
				map.put(key.toLowerCase(), value);
			} catch (UnsupportedEncodingException e) {
				e.printStackTrace();
			}
	
			// advance
			at = amp + 1;
		} while (at < len);
		return map;
	}

	/* END fix JDK */

	/**
	 * Override to handle additional system font ids as [id].ttf and additional
	 * names.
	 */
	public Resource createTrueType(String family) {
		// automatically handle 10.ttf - 19.ttf as ID refs
		if (family != null && family.matches("\\d+\\.ttf")) {
			try {
				int id = Integer.parseInt(family.substring(0, family.length()-4));
				if (id < 20 && id >= 10) {
					return new TrueTypeFalseResource(this, family, id);
				}
				if(id >= 20) {
					return getResource(new Integer(id));
				}
			} catch (Exception e) {
			}
		}
		// handle specific new names
		if (family.equals(TTF_SERIES4FONT)) {
			return new TrueTypeFalseResource(this, family, 13);
		} else if (family.equals(TTF_SERIES4FONTITALIC)) {
			return new TrueTypeFalseResource(this, family, 14);
		} else if (family.equals(TTF_SERIES4FONT3BOLD)) {
			return new TrueTypeFalseResource(this, family, 15);
//		} else if... {
		} else {
			// default behavior
			return super.createTrueType(family);
		}
	}

	/**
	 * Equivalent of TrueTypeResource except accessible to this class so we can
	 * instantiate additional names with a supplied id
	 */
	private static class TrueTypeFalseResource extends Resource {
		String name;

		TrueTypeFalseResource(Application app, String name, int id) {
			super(app, id);
			this.name = name;
			((V49BApplication)app).debug("Created font " + name + " with id " + id);
		}

		/**
		 * This is a thread-safe public entry point.
		 */
		protected void toString(StringBuffer buf) {
			synchronized (lock) {
				buf.append(",ttf=" + name);
			}
		}
	}
	
	
	private boolean waitingToInit;

	@Override
	protected void setContext(IContext context, int version) {
		super.setContext(context, version);
		// make accessible version of private Application class variable.
		this.protocolVersion = version;
		debug("Protocol Version per TiVo DVR: " + protocolVersion); //$NON-NLS-1$
	
		debug("attributes: " + context.getConnectionAttributes()); //$NON-NLS-1$
		// User-Agent: TvHttpClient -my tivo (and tsn=64...3E )
		// User-Agent: TmkHttpRequest/1.0 - from somebody on internet - old
		// version of tivo?
		// User-Agent=tivo.http/03/30/2003 - simulator
		// attributes: {Cookie=id=895df24b5038b953631128d3aa994863d51da2b1,
		// Host=192.168.0.20:7288, User-Agent=TvHttpClient, Connection=close,
		// tsn=64...3E}
		this.tivoID = context.getConnectionAttribute("tsn"); //$NON-NLS-1$
		// context.getConnectionAttribute(HTTP_HEADER_TIVO_ID);
		// tivoVersion is in DEVICE_INFO event under "version"
		// this.tivoVersion =
		// context.getConnectionAttribute(HTTP_HEADER_TIVO_VERSION);
	
	}

	/**
	 * You should override {@link #initBeforeResolutionSet(IContext)} to do your
	 * init work while this override handles resolution details after that is
	 * called.
	 */
	@Override
	public void init(IContext context) throws Exception {
		super.init(context);
		setActive(true);
		
		// template method for subclasses to perform init activities
		initBeforeResolutionSet(context);
		
		waitingToInit = true;
		boolean changed = setPreferredResolution();
		// will continue init on rootBoundsChanged()
	
		this.setActive(true);
	
		if (!changed || !isResolutionSupported()) {
			waitingToInit = false;
			showFirstPage();
		}

	}

	/**
	 * This override coordinates with the {@link #init(IContext)} override to
	 * call {@link #showFirstPage()} at the right time. Should probably override
	 * {@link #rootBoundsChangedBeforeFirstPage(Rectangle)} instead of this to
	 * maintain order of calls.
	 */
	@Override
	public void rootBoundsChanged(Rectangle rootBounds) {
		super.rootBoundsChanged(rootBounds);
		
		// template method for subclasses to perform rootbounds activities? maybe just subclass calling super is good enough here.
		rootBoundsChangedBeforeFirstPage(rootBounds);
		
		if (isResolutionSupported()) {
			if (waitingToInit) {
				waitingToInit = false;
				showFirstPage();
			}
		}
	}

	/**
	 * Resolution control is supported in protocol version 0.43 and SDK 1.4.1
	 */
	public boolean isResolutionSupported() {
		return this.protocolVersion >= VERSION_0_43 && isSDK141();
	}

	/**
	 * Stream Map argument is supported in protocol version 0.45 and SDK 1.4.1
	 */
	public boolean isStreamMapSupported() {
		return this.protocolVersion >= VERSION_0_45 && isSDK141();
	}

	/**
	 * Slide Remote is supported in protocol version 0.49
	 */
	public boolean isSlideRemoteSupported() {
		return this.protocolVersion >= VERSION_0_49;
	}

	/**
	 * Tries to get the version string from the com.tivo.hme.sdk.Version class
	 * which doesn't exist in all SDK versions. Returns null if it can't find
	 * the class.
	 * 
	 * @return
	 */
	public static String getSDKVersion() {
		try {
			if (Class.forName("com.tivo.hme.sdk.Version") != null) //$NON-NLS-1$
				return Version.getVersion();
			else
				return null;
		} catch (ClassNotFoundException e) {
			return null;
		}
	}

	public static boolean isSDK141() {
		if (getSDKVersion() != null)
			return getSDKVersion().startsWith("1.4.1"); //$NON-NLS-1$
		else
			return false;
	}

	/** a multi-SDK version of the SDK 1.4.1 method */
	public int getSafeActionHorizontal() {
		if (!isSDK141()) {
			return SAFE_ACTION_H;
		} else {
			return super.getSafeActionHorizontal();
		}
	}

	/** a multi-SDK version of the SDK 1.4.1 method */
	public int getSafeTitleVertical() {
		if (!isSDK141()) {
			return SAFE_TITLE_V;
		} else {
			return super.getSafeTitleVertical();
		}
	}

	/** a multi-SDK version of the SDK 1.4.1 method */
	public int getSafeActionVertical() {
		if (!isSDK141()) {
			return SAFE_ACTION_V;
		} else {
			return super.getSafeActionVertical();
		}
	}

	/** a multi-SDK version of the SDK 1.4.1 method */
	public int getSafeTitleHorizontal() {
		if (!isSDK141()) {
			return SAFE_TITLE_H;
		} else {
			return super.getSafeTitleHorizontal();
		}
	}

	
	/** Standard title area for e.g. a STREAM_LOOP_* background. */
	public Rectangle getTitleRegion() {
		int topPad = getSafeTitleVertical();
		int height = getSafeTitleToScrollTop()
				- 15;
		int leftPad = getSafeTitleHorizontal() + getSafeLogoToScrollTitle();
		int rightPad = getSafeTitleHorizontal();
		return new Rectangle(leftPad, topPad, getWidth()-leftPad-rightPad, height);
	}
	
	/** Standard logo area for e.g. a STREAM_LOOP_* background. */
	public Rectangle getLogoRegion() {
		int topPad = getSafeTitleVertical();
		int height = getSafeTitleToScrollTop()
				- 15;
		int leftPad = getSafeTitleHorizontal()
				- 20;
		int width = getSafeLogoToScrollTitle() + 10; // seems to fit, but shouldn't it be +20 to offset leftpad adjustment?
		return new Rectangle(leftPad, topPad, width, height);
	}

	/** Standard scroll area for e.g. a STREAM_LOOP_* background. */
	public Rectangle getScrollRegion() {
		int bottomPad = getSafeTitleVertical()+getSafeTitleToScrollBottom();
		int topPad = getSafeTitleVertical()+getSafeTitleToScrollTop();
		int leftPad = getSafeTitleHorizontal();
		int rightPad = getSafeTitleHorizontal();
		return new Rectangle(leftPad, topPad, getWidth()-leftPad-rightPad, getHeight()-topPad-bottomPad);
	}
	
	/**
	 * Vertical Space from safeTitle bottom to bottom of scrolling area of of a
	 * STREAM_LOOP_* background.
	 */
	public int getSafeTitleToScrollBottom() {
		if (isResolutionSupported() && getCurrentResolution().getHeight() > 480) {
			return 30;
		} else {
			return 15; // SD number
		}
	}

	/**
	 * Vertical Space from safeTitle top to top of scrolling area of a
	 * STREAM_LOOP_* background.
	 */
	public int getSafeTitleToScrollTop() {
		if (isResolutionSupported() && getCurrentResolution().getHeight() > 480) {
			return 85 + 60;
		} else {
			return 95; // SD number
		}
	}
	
	/**
	 * Horizontal space from safeTitle left to right edge of TiVo logo in the
	 * title area of a STREAM_LOOP_* background.  Note, logo extends a little to the left of the safeTitle left.
	 */
	public int getSafeLogoToScrollTitle() {
		if (isResolutionSupported() && getCurrentResolution().getHeight() > 480) {
			return 100; // could need a diff number for 720, but this will work.
		} else {
			return 45;// SD number - goes past "glow"
		}
	}
	
	protected void setMaxStackDepth(int max) {
		if (isSDK141()) {
			super.setMaxStackDepth(max);
		}
	}

	/**
	 * If {@link #isResolutionSupported()}, makes sure the resolution is the
	 * preferred one, and if it's not, calls
	 * {@link #setReceiverResolution(com.tivo.hme.sdk.Resolution)} with the
	 * ResolutionInfo's preferred resolution.
	 * 
	 * @return true if {@link #setReceiverResolution(com.tivo.hme.sdk.Resolution)} was actually called.
	 */
	protected boolean setPreferredResolution() {
			/* BEGIN HME 1.4.1e only */
			if (isResolutionSupported()) {
				boolean noChangeNeeded = this
						.getReceiverResolutionInfo()
						.getPreferredRenderingResolution()
						.equals(this.getReceiverResolutionInfo()
								.getRenderingResolution());
				if (noChangeNeeded) {
	//				debugOut(this.getCurrentResolution()+" is already preferred resolution of "+this.getReceiverResolutionInfo().getAvailableRenderingResolutions());
					return false;
				} else {
	//				 debugOut(this.getCurrentResolution()
	//						 +" => "+this.getReceiverResolutionInfo().getPreferredRenderingResolution()+" of "+this.getReceiverResolutionInfo().getAvailableRenderingResolutions());
					this.setReceiverResolution(this.getReceiverResolutionInfo()
							.getPreferredRenderingResolution());
					return true;
				}
			}
			/* END HME 1.4.1e only */
			return false;
		}

}

V49BApplicationFactory.java:


Code:


package com.blackledge.david.tivo;

import java.io.IOException;

import com.tivo.hme.interfaces.IApplication;
import com.tivo.hme.interfaces.IContext;
import com.tivo.hme.interfaces.ILogger;
import com.tivo.hme.sdk.Factory;
import com.tivo.hme.sdk.IHmeProtocol;
import com.tivo.hme.sdk.io.HmeInputStream;
import com.tivo.hme.sdk.io.HmeOutputStream;

/**
 * Factory that creates the {@link V49BApplication} to report its version to the
 * TiVo as VERSION_0_49. (V49BApplication required for createApplication
 * duplicate to have correct method access).
 */
public class V49BApplicationFactory extends Factory {
	/**
	 * Override to report a different HME version by calling
	 * {@link #supercreateApplication(IContext, int)}.
	 */
	@Override
	public IApplication createApplication(IContext context)
			throws IOException {
        int sentVersion = 
//                IHmeProtocol.VERSION;
        		V49IHmeProtocol.VERSION_0_49;
//        		IHmeProtocol.VERSION_0_40;
        
		IApplication application = supercreateApplication(context, sentVersion);
		
		return application;
	}
	
	/**
	 * Copy of super factory implementation with parameterized version number to
	 * send to TiVo.
	 */
    public IApplication supercreateApplication(IContext context, int sentVersion) throws IOException
    {
	int version = -1;
        HmeOutputStream out = null;
        HmeInputStream in = null;

        synchronized (lock) {                   // lock this factory
            if (context.getOutputStream() instanceof HmeOutputStream) {
                out = (HmeOutputStream)context.getOutputStream();
	    }
            else {
                out = new HmeOutputStream(context.getOutputStream());
	    }
            
            if (context.getInputStream() instanceof HmeInputStream) {
                in = (HmeInputStream)context.getInputStream();
            } else {
                in = new HmeInputStream(context.getInputStream());
	    }
            
            // HME protocol starts here
	    // Synchronize and flush the writes, so that no other writer 
	    // interleaves within our data
	    synchronized (out.getMonitor()) {
                out.writeInt(IHmeProtocol.MAGIC);
                out.writeInt(
//                		IHmeProtocol.VERSION
                		sentVersion
                		);
                out.flush();
	    }
		
            // read magic and version
            int magic = in.readInt();
            if (magic != IHmeProtocol.MAGIC) {
                throw new IOException(
		    "bad magic: 0x" + Integer.toHexString(magic)
//		    +getIdForException());
		    );
            }
            version = in.readInt();
            if (version >> 8 < 
//            IHmeProtocol.VERSION
            sentVersion
            >> 8 ) {
                throw new IOException(
                        "version mismatch: " + 
                        ( version >> 8 ) + "." + ( version & 0xff ) +
                        " < " +
                        ( 
//                        		IHmeProtocol.VERSION
                        		sentVersion
                        		>> 8 ) + "." + ( 
//                        				IHmeProtocol.VERSION
                        				sentVersion
                        				& 0xff )
//			+ getIdForException());
                        );
            }
        } // synchronized

        // maintain proper order of locks -- we have released 
        // the factory monitor before entering the app monitor
    
        IApplication retApp = null;
        try {
//            Application app = (Application)clazz.newInstance();
        	// have to have local class to access setContext
        	V49BApplication app = (V49BApplication)clazz.newInstance();
            synchronized (app) {
                app.setFactory(this);
                app.setContext(context, version);
		app.setMonitor(app);
                retApp = app;
            }
        } catch (InstantiationException ex) {
	    log(ILogger.LOG_NOTICE, ex);
        } catch (IllegalAccessException ex) {
	    log(ILogger.LOG_NOTICE, ex);
        }

	out.flush();

        return retApp;
    } // createApplication()
	
}


----------



## davidblackledge

After the overwhelming lack of interest in the last update, I just went forward with the cheapest host I could come up with for a beta of a public server.

"Add a server" or "Add an app" with IP 212.1.209.140

This will add Enter Webz in server mode. This means the Apps group drives what specific links or groups show up as "apps" at the top level on your TiVo.

The default thumztaks give you a lot of top-level Apps. They use genres so in Series 4+ HD UIs, some Apps are in the music and photos section while other entries are in the apps section. Default icons are also based on genres.

music: Shoutcast Radio Stations
music: Live Concerts at archive.org
music: M​ore/ (last.fm, Audio Books, MP3tunes)​
photos: Comics & LOLz/
photos: Flickr
videos: Feature Films at archive.org
videos: YouTube mobile
videos: ​More/ (Classic TV, Amazon download launch, late night lineups...)
Facebook
Twitter ​ -​ ​@​TiVo ​ (won't allow connection??)​
Email, Finance, etc./ (Google mail / voice, Mapquest, E*Trade...)
Sports & Weather/
​Shopping/ (Amazon, Ebay...)
_As a bonus, the server also has my *Solitaire, Freecell, and Gene Wadleigh's Mahjongg*._

THIS IS STILL A BETA - If you wander to random websites it WILL reboot your TiVo in all likelihood, but the default listed ones seem to work well. This problem won't change in the future, but I hope to put warnings and safeguards up.
Don't be surprised if it goes down or gets slow if this somehow becomes popular. If I find the need to upgrade the server, the IP Address WILL CHANGE.
And in general, there's still a lot to do to have this feel vaguely like quality.

Today's version includes image size and textarea bug fixes (necessary for e.g. Facebook and twitter status updates)

_One problem: it looks like Twitter blocks my host - I'm guessing spammers must have set up shop there, too - so Twitter just times out and never connects. I'll try to contact them to make an exception for my IP, I guess._

Note the "Amazon download launch" mentioned above - that's the "Amazon: Your Video Library" page to initiate a push from an old Amazon video purchase to one of your TiVos... it's not pretty, but I believe it's functional.


----------



## Fofer

Sounds great! Can't wait to try it when I get back home!


----------



## dadrepus

Just tried it. Only tried established programs/games but EVERYTHING worked as promised. From my Mac install to boot! YEA. Can't wait to see what more you have in mind for this clever Application.
thanks for continuing to pursue this.


----------



## jgametest

Sent David a PM via his email, there is much potential for what his app will bring to the community now that it's being hosted live via IP. It kind of picks up where apps.tv left off but in a whole new direction of hope. I would imagine once the Opera SDK gets off then more opportunity will arise. Now if only I can get his browser to talk to my Plex server I would be very happy. I forced my Plex to use the Opera browser in TiVo through KMTTG and it did it even let me sign into it but would not let me navigate anywhere. I will have to try this idea again this time using Enterthewebz.


----------



## Fofer

dadrepus said:


> Just tried it. Only tried established programs/games but EVERYTHING worked as promised. From my *Mac install* to boot! YEA.


"Mac install?" Why is that needed, now that it is hosted live via IP? I thought the whole point of that upgrade is that we don't need any software installed (or server hosted) on our LAN.


----------



## wmcbrine

davidblackledge said:


> 212.1.209.140


1. How do you do the purple box around each menu item?
2. How can I turn that off?


----------



## jgametest

With Winamp closing it's doors at the end of the month it's unsure what will happen to the @Shoutcast servers. I sent a tweet to the NY office to find out the details apparently many companies rely on this feed of Mp3's. 

With IP binded I found new choices in my Music category: More music, Shoutcast, and Concerts.

On a different note, the TiVo played POP & Seasonal very clear. =)
Lookout Pandora more options are coming, the same threat Live365 felt when Pandora arrived.


----------



## davidblackledge

jgametest said:


> It kind of picks up where apps.tv left off but in a whole new direction of hope.


Yeah, that was kind of my thought, too!


jgametest said:


> Now if only I can get his browser to talk to my Plex server I would be very happy. I forced my Plex to use the Opera browser in TiVo through KMTTG and it did it even let me sign into it but would not let me navigate anywhere. I will have to try this idea again this time using Enterthewebz.


Well, here's where we run into the downside of a public server. Your Plex server is on your home network, behind a firewall that the Enter Webz public server can't see through. Same issue with pyTivo running on your home network.

I plan to make a diagram and a simple website for Enter Webz to explain this kind of stuff.


----------



## davidblackledge

Fofer said:


> "Mac install?" Why is that needed, now that it is hosted live via IP? I thought the whole point of that upgrade is that we don't need any software installed (or server hosted) on our LAN.


You are correct... I think dadrepus was just excited because we could never get the download to work on his Mac ;]


----------



## davidblackledge

wmcbrine said:


> 1. How do you do the purple box around each menu item?
> 2. How can I turn that off?


I love to surprise wmcbrine ;]

It ends up, the HDUI handles app icons differently than they used to. 
An incorrectly sized icon on Series 3 either shows nothing or just centers and crops to size. 
The HDUI tries to show the whole thing aligned to the upper left corner, regardless of the size. This makes for some messy results for some websites where Enter Webz grabs an iPad-style icon that's very large, but inspired me to do this trick.

The purple box is an experimental Premiere-(and Roamio?)-only icon set sized carefully to fit the App title with a transparent area to let the title show through.

I'll eventually replace that with either a normal icon or a more subtle use of the trick.

It only has that for "other" genre thumztaks (without their own icon) and groups, so you can "turn it off" by deleting those entries or moving them to the video genre.

I also intend to eventually make the thumztak icon user-editable so you can set it if it's blank, or fix it if it's an oversized one. That doesn't include groups, though.


----------



## jgametest

There is an open player called flowplayer it makes flash available from your own site. Could this be adopted into Webz or does it need the Opera SDK active for use?

flowplayerDOTorg <-- replace dot with a .


----------



## davidblackledge

jgametest said:


> There is an open player called flowplayer it makes flash available from your own site. Could this be adopted into Webz or does it need the Opera SDK active for use?
> 
> flowplayerDOTorg <-- replace dot with a .


Well, Enter Webz won't ever run Flash. But the rest of that site uses the HTML5 VIDEO tag which Enter Webz does handle. A VIDEO tag with the right format of video is shown in Enter Webz with either a "poster" image or (in the case of that site) a default video icon.

The videos on that site appear to be an incompatible format of mp4, but other than that, it "works."


----------



## jgametest

David, I've advised the TCM community to take a look at your IP project. yesterday Google released an updated youtube app and seems to be making everyone see RED. It's not an easy monster to navigate and it seems to not want to play many video formats. Whereas your EntertheWebz does it seems a nicer tradeoff vs. do what now? What do you mean I forgot to hit go back to get up left right PLAY something. No it's really not engineered using KISS it's more like KISSOFF. 

http://www.tivocommunity.com/tivo-vb/showthread.php?t=512002


----------



## steinbch

Pretty neat implementation. Thanks!

Is there a way to remove the whole thing though? All the apps stayed after a restart and resetting the HDUI. Can't find a way to remove all of the apps or the IP from TiVos memory.


----------



## jgametest

Highlight the app you wish to remove and hit CLEAR answer the question to remove.


----------



## davidblackledge

steinbch said:


> Pretty neat implementation. Thanks!
> 
> Is there a way to remove the whole thing though? All the apps stayed after a restart and resetting the HDUI. Can't find a way to remove all of the apps or the IP from TiVos memory.




Alternatively, you can customize it:
Start the Enter Webz" entry at the bottom, select the "Apps" group, and either:
use Thumbs Down ( :down: ) to remove entries you don't want any more
OR
use Enter to edit an entry and move it to a group other than "Apps"

That will reduce you to just a few permanent entries

(ack... my keyboard went crazy right at the end and I can't edit the title now :/ the title was supposed to say "Don't remove the whole thing, customize!")


----------



## steinbch

Thanks! Will try it out tonight. Thanks for all of your developmental efforts!


----------



## steinbch

I went and tried both methods (using Clear button in TiVo Central and using Thumbs Down while in Webz interface). Both of these have caused issues for me.

Using the Clear button while in TiVo Central removed all of the Webz apps located in SHowcases & Apps, but did not remove any of the extra apps in Music & Photos. Adding Webz again and clearing for a second time removed ALL apps, including those from TiVo from showing up in Showcases & Apps menu.

Using the Thumbs Down option worked while in the Webz interface, but as soon as I exted the Webz App, nothing changed in TiVo Central and returning to the Webz interface showed that no changes were saved.

Thoughts?


----------



## davidblackledge

steinbch said:


> I went and tried both methods (using Clear button in TiVo Central and using Thumbs Down while in Webz interface). Both of these have caused issues for me.
> 
> Using the Clear button while in TiVo Central removed all of the Webz apps located in SHowcases & Apps, but did not remove any of the extra apps in Music & Photos. Adding Webz again and clearing for a second time removed ALL apps, including those from TiVo from showing up in Showcases & Apps menu.
> 
> Using the Thumbs Down option worked while in the Webz interface, but as soon as I exted the Webz App, nothing changed in TiVo Central and returning to the Webz interface showed that no changes were saved.
> 
> Thoughts?


Sorry, I should have explained that with the original IP server post.

The Premiere and above TiVos remember the list of apps so it doesn't take forever to show the list like it does on TiVo HD and below.

For editing the list from Enter Webz, this becomes a problem. I have set it to expire after 5 minutes, but the TiVo doesn't even check the expiration unless you leave the top UI.

If you go to your Show list and come back (and 5 minutes have passed since the TiVo last loaded the App List), it should reload fine.

The balancing act is that it takes forever to load that list, but you want it as current as possible. I actually don't like the 5 minute setting I currently use - once you're happy with your app list, you don't want to have a long load time every time you come back from your show list. I'll probably increase the time limit and add a note when you change something in the Apps folder "your changes will appear in about N minutes."

As for the "clear" app delete, I guess the Music & Photos area just doesn't notice when you delete the App, but it should disappear from there after a leave/come back type of reload.

... as for the changes not being there when you got back into the Apps folder, two possibilities. One: if you deleted EVERY ONE of the bookmarks, then it re-filled them with the defaults (ones that aren't in the Apps folder won't get in your way so they don't need to be deleted). Two: weird timing vs. when you did the "clear" delete might have caused the defaults to be loaded again.


----------



## steinbch

davidblackledge said:


> Sorry, I should have explained that with the original IP server post.
> 
> The Premiere and above TiVos remember the list of apps so it doesn't take forever to show the list like it does on TiVo HD and below.
> 
> For editing the list from Enter Webz, this becomes a problem. I have set it to expire after 5 minutes, but the TiVo doesn't even check the expiration unless you leave the top UI.
> 
> If you go to your Show list and come back (and 5 minutes have passed since the TiVo last loaded the App List), it should reload fine.
> 
> The balancing act is that it takes forever to load that list, but you want it as current as possible. I actually don't like the 5 minute setting I currently use - once you're happy with your app list, you don't want to have a long load time every time you come back from your show list. I'll probably increase the time limit and add a note when you change something in the Apps folder "your changes will appear in about N minutes."
> 
> As for the "clear" app delete, I guess the Music & Photos area just doesn't notice when you delete the App, but it should disappear from there after a leave/come back type of reload.
> 
> ... as for the changes not being there when you got back into the Apps folder, two possibilities. One: if you deleted EVERY ONE of the bookmarks, then it re-filled them with the defaults (ones that aren't in the Apps folder won't get in your way so they don't need to be deleted). Two: weird timing vs. when you did the "clear" delete might have caused the defaults to be loaded again.


Thanks for the information. I let it go over night after removing and it looks like all the apps cleared like I expected.


----------



## jgametest

While it's nice to be able to access my facebook account and click on the photos to show the kids, I noticed there is no way to go into the next image without hitting the LEFT arrow on the remote to click on another image. In some instances this would cause "EntertheWebz" to force exit back to Tivo Main. Does it matter if I used the settings to adjust to maximum vs. a preset number for size? This option only appears when on a website and hit INFO to access the setting controls.

Also to prevent burn in for prolong use with features such as Shoutcast, might want to consider adding some kind of Screensaver/dimmer control. Some of your featured sites are using an extreme white backgrounds and that can be troublesome for some LCD/Plasma screens.

Other than, was fun to play mahjong and solitaire on Tivo.


----------



## davidblackledge

jgametest said:


> While it's nice to be able to access my facebook account and click on the photos to show the kids, I noticed there is no way to go into the next image without hitting the LEFT arrow on the remote to click on another image. In some instances this would cause "EntertheWebz" to force exit back to Tivo Main. Does it matter if I used the settings to adjust to maximum vs. a preset number for size? This option only appears when on a website and hit INFO to access the setting controls.


Well, the flow of the facebook app is up to facebook - it is their mobile site and works however they set it up to work. For some reason they chose to make the images not work well as a slideshow type of interface.

The sudden exiting is the TiVo running out of memory or something like that. It will happen with a lot of browsing, especially with lots of images. The TiVo doesn't tell Enter Webz anything to let me protect against that, unfortunately.

Yes, choosing a different font size can affect how well Enter Webz works (in addition to how visible the text is). Sometimes it's better, sometimes worse, depending on how a page is laid out. On my TiVo HD, gmail breaks if I set the font too large, but on some pages with lots of images, a larger font size makes sure less show up on the screen at once, and things work better.



> Also to prevent burn in for prolong use with features such as Shoutcast, might want to consider adding some kind of Screensaver/dimmer control. Some of your featured sites are using an extreme white backgrounds and that can be troublesome for some LCD/Plasma screens.


Actually, it does do that. When your TiVo tells Enter Webz you haven't touched the remote for some amount of time (I think it's 10 minutes) Enter Webz does one of three things. If you have a video playing it makes it full screen. If you're playing an audio stream, it dims the screen by to about 90%. If you're not doing either, it quits. If you hit any remote button, the TiVo says you're not idle (and if the screen is dimmed, Enter Webz un-dims it) and the timer starts over.

There is also a separate "dimmer" feature that I haven't finished in Enter Webz. If you turn that on from the "info" menu, it slightly dims the screen for those bright white pages, but currently it doesn't stay dimmed when you go to another page. Do you think fixing that feature would be valuable?



> Other than, was fun to play mahjong and solitaire on Tivo.


Great!


----------



## Fofer

davidblackledge said:


> There is also a separate "dimmer" feature that I haven't finished in Enter Webz. If you turn that on from the "info" menu, it slightly dims the screen for those bright white pages, but currently it doesn't stay dimmed when you go to another page. Do you think fixing that feature would be valuable?


Yes, yes, 1000x yes!


----------



## jgametest

I think if there was a way to preset webpages with white backgrounds to be dimmer would save many from brightness to the eyes or mild headaches for eye strain. I have no way of reducing my brightness on my tv, as my kids destroyed my main remote. Even though Tivo acts like a semi-universal remote I am unable to access those functions.

So in my case it would be ideal.

That said, it would be less on you if we just choose a default setting of dimmer with a keystroke on the remote perhaps make it one of the letter buttons A, B, C or D.


----------



## davidblackledge

Fofer said:


> Yes, yes, 1000x yes!





jgametest said:


> So in my case it would be ideal.
> 
> That said, it would be less on you if we just choose a default setting of dimmer with a keystroke on the remote perhaps make it one of the letter buttons A, B, C or D.


Done.
Action "D" turns on/off the Dimmer.
It is a saved setting so it will still be in effect next time you use Enter Webz, and it's still available in the "info" menu.

This update also turns off the cute TiVo Loopset animation backgrounds... they're trouble when it comes to playing videos and Enter Webz has enough trouble.

Anybody just catching up, that's on the Enter Webz public server:
"Add an App" with 212.1.209.140


----------



## jgametest

Not sure how, but it looks to me it's in a different country and language. I says I'm in English but I know that is not Youtube for the United States. How to do we reset the defaults if we can?


----------



## davidblackledge

jgametest said:


> Not sure how, but it looks to me it's in a different country and language. I says I'm in English but I know that is not Youtube for the United States. How to do we reset the defaults if we can?


Yeah, I have the same problem... when you sign in, it's fixed.

Google seems to think the Enter Webz server is in Spain... my hosting provider says it's in the US, but Google might be having trouble because I haven't registered a domain name for the IP, yet.

Basically, Google's trying to be too smart for an unusual setup like Enter Webz.

By the way... I think I may have found the solution to the problem where Google will eventually request a login, then Enter Webz can't log in anymore unless you clear cookies. I'll post again when I've verified. maybe tonight.


----------



## jgametest

Not sure if this is a way to consider but it's free.
http://www.noip.com/ once you create an account David there is an option to forward the IP to a physical virtual domain name. Obviously on TiVo we would only use the ip numbers but this will register to the domain networks quickly and it should offset the mess at Google or future troubles. It's a pretty cool feature for a while I used it when I needed to remote in home. But with services like Plex and TeamViewer that need came and went.


----------



## berkinet

#1. Thanks for your work on this cool app.

Now, trying to run on MacOS (10.9.1). First I found I needed to convert the shell (.sh) script to unix (\n) line endings. (I didn't use the .command file, but I am sure it would require the same change.)
Then, the command line in the shell (and command) file needs a debug level. As shipped it is just:

java -Dcom.tivo.hme.sdk.debug.level=
instead of

java -Dcom.tivo.hme.sdk.debug.level=0

That got the jar opened and started. However, I then found that, at least on the Mac, the app seems to select the IP interface at random... it should use the first entry for multi-homed machined. I just disabled my secondary address and that got everything started.

Unfortunately, at that point, while I could open most of the apps, text displays were wrong (like escaped non-printable characters: \032, etc.) and worst of all, nothing really worked. Note the public server at 212.1.209.140 works just fine.

Finally, I was stumped on where the /app root is actually located. Is that covered somewhere in the docs?

FWIW, I have a Roamio+


----------



## davidblackledge

berkinet said:


> #1. Thanks for your work on this cool app.


 Thanks!


> Now, trying to run on MacOS (10.9.1). First I found I needed to convert the shell (.sh) script to unix (\n) line endings. (I didn't use the .command file, but I am sure it would require the same change.)
> Then, the command line in the shell (and command) file needs a debug level. As shipped it is just:
> 
> java -Dcom.tivo.hme.sdk.debug.level=
> instead of
> 
> java -Dcom.tivo.hme.sdk.debug.level=0


Strange. You're using the 2013-10-31 zip, right? I just downloaded a copy to double-check. That one has the .sh and .command files processed to change the line endings (versus the .bat file). Maybe I did the wrong conversion? _(I also tried to process them to be executable, but apparently that processing command doesn't work when run from Windows)_
I also don't see the missing "0" in the files. Maybe that happened upon your line end conversion.


> That got the jar opened and started. However, I then found that, at least on the Mac, the app seems to select the IP interface at random... it should use the first entry for multi-homed machined. I just disabled my secondary address and that got everything started.


Ah, I haven't had to deal with this. There is a feature for it, though. I believe if you add --intf 1.2.3.4 to the command line it will use that IP interface explicitly.


> Unfortunately, at that point, while I could open most of the apps, text displays were wrong (like escaped non-printable characters: \032, etc.) and worst of all, nothing really worked. Note the public server at 212.1.209.140 works just fine.


The escaping in the app titles is a bug of the new HD UIs...they're not following their own standard. If you switch to the SD UI, I think that goes away, for instance. It only happens in the home-network-automatic-discovery mode which is why it doesn't happen on the public server.

Could you describe "nothing really worked" in more detail? maybe I could help with that. If there is any interesting output in the command window when something doesn't work, please copy and paste it.

Anyhow, I'm glad the public server works. It's really the same code just launching a different way and from within your home network and your own Java VM.


> Finally, I was stumped on where the /app root is actually located. Is that covered somewhere in the docs?
> 
> FWIW, I have a Roamio+


Well, for the downloaded version, it's a matter of a) editing the launcher.txt file about what you want as an App (either explicit links, or explicit groups), and b) editing your thumztaks from within the App (thumbs up/down to add/remove them, Enter to edit the name and group, and numbers to rearrange the order). The App root in that case is the "Apps" group and the genre-specific Apps/music, photos, and video groups. However, for the downloaded version, you can tell it to use any group as an App, not just the Apps group.
On the public server, it's all just about moving thumztaks into or out of the Apps groups. Anything placed in those groups is automatically listed as a top-level App the next time the list is fully reloaded by the TiVo.
Physically, all the options and thumztaks, and cookies are stored in a file located in a folder named "tivo" or ".tivo" under the user's home directory... I think that's correct on Mac.

Let me know if you have any other questions or comments, or if you find some websites that work well!


----------



## davidblackledge

FYI, everybody, EnterWebz.tv is live now, too. Some basic information there now. 
Lots still to do on the website and the App, though.

So, 50+ subscribers to date, let us know how it's going, what should change, and what websites work well!


----------



## berkinet

davidblackledge said:


> ...Strange. You're using the 2013-10-31 zip, right? I just downloaded a copy to double-check. That one has the .sh and .command files processed to change the line endings (versus the .bat file). Maybe I did the wrong conversion? _(I also tried to process them to be executable, but apparently that processing command doesn't work when run from Windows)_
> I also don't see the missing "0" in the files. Maybe that happened upon your line end conversion.


Yes, it was 2013-10-31. And I am sure of the line endings and missing zero. But, I just downloaded it again and, for whatever reason, the .sh file is correct (\n) endings). However, the .command file has \r for the line ending character. Also, the 0 debugging option is there. Mysterious.

BTW, the first time both files had \r\n endings and I just used _tr_ to remove the \r. So, that shouldn't have had any affect on the =0.



davidblackledge said:


> ... if you add --intf 1.2.3.4 to the command line it will use that IP interface explicitly.


That did the trick. Thanks.



davidblackledge said:


> The escaping in the app titles is a bug of the new HD UIs...they're not following their own standard. If you switch to the SD UI, I think that goes away, for instance.


I have a Roamio+ and I don't think the SD option exists... I can change the output to 480i only, but it still uses the HD menus.



davidblackledge said:


> Could you describe "nothing really worked" in more detail? maybe I could help with that. If there is any interesting output in the command window when something doesn't work, please copy and paste it.


Sorry, I should have been more exact. I can navigate the directory structure, but any web (i.e., URL) option I select, google, for example, results in an on screen message: App Temporarily Unavailable..." with an error code of V301. Reversi works!

The stderr output shows:


Code:


LOG: null
*** new cookiestore! ***
LOG: unknown event opcode : 10
Writing no data
LOG: connection to receiver closed

 followed by a single java error. Here are the one's I have seen so far:


Code:


LOG: Unexpected error: com.tivo.hme.sdk.HmeException: java.net.SocketException: Broken pipe, app=/webz/
LOG: Unexpected error: com.tivo.hme.sdk.HmeException: java.net.SocketException: Broken pipe, app=/webz/
LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown

Hope this helps. Let me know if there is anything you want me to do to test.


----------



## davidblackledge

berkinet said:


> Yes, it was 2013-10-31. And I am sure of the line endings and missing zero. But, I just downloaded it again and, for whatever reason, the .sh file is correct (\n) endings). However, the .command file has \r for the line ending character. Also, the 0 debugging option is there. Mysterious.


 Wow... very weird. I am doing eol="mac" processing on the .command and eol="unix" processing on the .sh (this is with the Ant fixcrlf command)... sounds like the result is backwards to what you need.



> I have a Roamio+ and I don't think the SD option exists... I can change the output to 480i only, but it still uses the HD menus.


The option on Premiere is buried somewhere... and probably the same for Roamio. I don't recommend switching anyhow... it was just to show that the "old" interface code handles the titles correctly.



> The stderr output shows:
> 
> 
> Code:
> 
> 
> LOG: null
> *** new cookiestore! ***
> LOG: unknown event opcode : 10
> Writing no data
> LOG: connection to receiver closed
> 
> followed by a single java error. Here are the one's I have seen so far:
> 
> 
> Code:
> 
> 
> LOG: Unexpected error: com.tivo.hme.sdk.HmeException: java.net.SocketException: Broken pipe, app=/webz/
> LOG: Unexpected error: com.tivo.hme.sdk.HmeException: java.net.SocketException: Broken pipe, app=/webz/
> LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown


Dang. I thought I fixed this (you're running from that "good" copy you re-downloaded, right?)... I guess my theory was wrong:


davidblackledge said:


> My working theory is: HTMLBreakdown does a lot of work, but it includes the code to translate special characters from unicode that the TiVo can't display into ASCII equivalents. My Internet searches hinted at possible issues with Unicode differences on the Mac (probably depending on OS and Java version).
> 
> For the next release, I'll change how the unicode references are made in hopes that it helps, and I'll probably also move all of that translation code to a separate class and protect it so if that exception happens, Enter Webz doesn't break, it just doesn't do the translation (and you get a bunch of "squares" on the screen for complex characters).


If you're running the latest code and this is still happening, then there is something completely different that causes that problem. But, I THINK there are some Mac users that AREN'T getting that problem.

*Any Mac users* that have gotten Enter Webz to work locally on their Mac, could you post some information? Maybe Mac version and Java version (type java --version in a command window)? Then we can compare against those having the problem.


----------



## tatergator1

davidblackledge said:


> The option on Premiere is buried somewhere... and probably the same for Roamio.


FYI, Tivo removed the option to use SD menus in the Roamio software.


----------



## davidblackledge

berkinet said:


> Here are the one's I have seen so far:
> 
> 
> Code:
> 
> 
> LOG: Unexpected error: com.tivo.hme.sdk.HmeException: java.net.SocketException: Broken pipe, app=/webz/
> LOG: Unexpected error: com.tivo.hme.sdk.HmeException: java.net.SocketException: Broken pipe, app=/webz/
> LOG: Unexpected error: java.lang.NoClassDefFoundError: Could not initialize class com.blackledge.david.html.hme.HTMLBreakdown
> 
> Hope this helps. Let me know if there is anything you want me to do to test.


try adding


Code:


-Djava.awt.headless=true

before or after the debug definition in the command.


----------



## berkinet

davidblackledge said:


> try adding
> 
> 
> Code:
> 
> 
> -Djava.awt.headless=true
> 
> before or after the debug definition in the command.


No joy...


Code:


LOG: null
*** new cookiestore! ***
LOG: unknown event opcode : 10
LOG: connection to receiver closed
LOG: Unexpected error: java.lang.ExceptionInInitializerError

Here's my java version...


Code:


java -version
java version "1.6.0_65"
Java(TM) SE Runtime Environment (build 1.6.0_65-b14-462-11M4609)
Java HotSpot(TM) 64-Bit Server VM (build 20.65-b04-462, mixed mode)

And, FWIW... here's my shell script:


Code:


#!/bin/bash
# thanks to windracer
mydir=`dirname "$0"`
cd "$mydir"
java -Dcom.tivo.hme.sdk.debug.level=0 -Djava.awt.headless=true -jar EnterWebz.jar --launcher launcher.txt --intf 192.168.4.94


----------



## jgametest

Sorry David, but it looks there could be either good news or bad news for Shoutcast Radio. http://betanews.com/2014/01/01/winamp-finds-a-buyer-and-its-not-microsoft/

Will have to see how the weeks playout before an official announcement is made.


----------



## davidblackledge

jgametest said:


> Sorry David, but it looks there could be either good news or bad news for Shoutcast Radio. http://betanews.com/2014/01/01/winamp-finds-a-buyer-and-its-not-microsoft/


I'm not worried.

First, I expect whoever takes ownership will keep the website running, or even make it better.

Second, if it does go down, there are lots of fish in the sea.
In fact, while fishing, I found http://mobile.internet-radio.com/ which doesn't have shoutcast's broken "next" button. I'm considering replacing shoutcast with it for new users, actually.


----------



## davidblackledge

New version available for download at http://david.blackledge.com/tivo/enterwebz/
Just to keep up with the public server and hopefully help with Mac installs.

EnterWebzDist-2014-1-9.zip: Leave thumztaks screens in history; remove loopset backgrounds; Dimmer control fixed and activates with "D"; fix Mac issues?; fixed another bug

If you don't need the downloaded version, then go to http://EnterWebz.tv for the public server instructions.



berkinet said:


> No joy...
> 
> 
> Code:
> 
> 
> LOG: null
> LOG: Unexpected error: java.lang.ExceptionInInitializerError


Interesting that the error appears to have changed. Anyhow, try this new version. I made a few changes that might be relevant. You'll have to edit it to add the --intf again. If this new one doesn't work, try the "headless" part again, as well.


----------



## jgametest

Hi David,

While the team is looking for a backdoor to reverse engineer streams, I would like to know would it be possible to allow us the ability to browse internal pages. Services like Plex create an internal page for us to browse which I can access within your browser if I connect from www.plex.tv but the current browser does not handle playback of video formats when I choose a prompt of video TiVo sends an alert that states "Unable to play format". Both Tivo and Opera have not commented if they intend to open the browser ability from the SDK that we all received. It's either hush / hush or they have not figured out how to make it work yet. So in the meantime, I will continue researching server / playback options that might handle the request better. Perhaps cloud playback is the way to go.

John


----------



## davidblackledge

jgametest said:


> Services like Plex create an internal page for us to browse which I can access within your browser if I connect from www.plex.tv but the current browser does not handle playback of video formats when I choose a prompt of video TiVo sends an alert that states "Unable to play format".


I figure I've maximized Enter Webz's ability to do playbacks by using TiVo's own VideoPlayer app for any video stream it encounters. If it can be done in HME, that App should be able to do it.

However, there are a couple of question marks in my technique.
I do send it an http instead of https URL since everything seems to need that on the TiVo. I don't know that I ever did enough testing to verify it's truly required for the VideoPlayer.
I do try to handle redirections and such BEFORE I send it to the VideoPlayer which I believe is required in a similar way as http vs. https, but again I don't have time to test all the possibilities.
There is a possibility the exact video format I tell the VideoPlayer influences the playback abilities. I send what I have, but perhaps that's not always exactly what VideoPlayer needs. (for instance perhaps the format info from the website is too vague, or perhaps its not even correct at all)... that said, Enter Webz couldn't improve on that without analyzing the video stream which I have no intention of doing.
There is a possibility that some videos could work if I directly tried to stream them myself instead of using the VideoPlayer, but I find that unlikely.

Finally, of the most value here, some websites will provide a different video stream depending on what kind of browser Enter Webz claims to be. At the very least, I could probably set the "accept" header in Enter Webz to specifically only include the video (etc) formats that truly work with a TiVo, and maybe the website will cooperate.

But the short answer is: I believe Enter Webz does the best thing it can do to maximize video playback.


----------



## davidblackledge

Yesterday I finally installed the latest update to EnterWebz.tv... I didn't bother to make a new download release, though.
It just added mode information in the status area, makes recognizable control hints (and model-appropriate) everywhere, uses the genre-specific group icons within the app group pages themselves, and gives more space for banners.

Of particular "Developer's Corner" interest is how I made the hints "model-appropriate."

I made a spreadsheet of TiVo models with key facts including the remote they come with by default.
Then I made a spreadsheet of remote models with keys and how they're labeled.
So my hints use your TSN to drive whether the button displays at all and how it is represented (both icon and text), matching your remote. 
Perhaps later I'll add a remote selector to say "no, I have a Slide Remote!"

The icons I used for this release are not good... I'll switch them with just plain symbols (not pictures of the buttons) and let the text labels do the rest of the work. And I'm missing some like action buttons.

The spreadsheets are incomplete, but good enough for my purposes. I got information from a variety of incomplete sources (mostly TiVo and Weaknees). They also include stuff from my server that isn't documented anywhere else publicly I've seen (e.g. D18, A90, AE2, and 1E2 models).

I want to share this with the dev community to fill in missing parts and use them for your own purposes. (I just export csv files and include that with my app)
I have them in Google Docs and have it editable by anybody with the link. Hopefully I can still recover it, as owner, if it gets griefed.

Model Info:
https://docs.google.com/spreadsheet/ccc?key=0AsOdOJNsln8YdGlnTXFwUHBtU1Y3eG9zQ01fdnhJWWc&usp=sharing

Remote Info:
https://docs.google.com/spreadsheet/ccc?key=0AsOdOJNsln8YdDE0V3IwM2llS2lFa0sweW9Cald6b3c&usp=sharing

Add any new columns at the end, please (E.g. Models wants an Image column like Remotes).

Model's drive size 0 is explicitly devices without storage. SW version is just because my source data had it (I won't keep that up to date). I recently added "platform" and "brand" columns from the HME DEVICE_INFO event, too. The "series" column is values I made up to try to group things, but it's not quite right for weird models - platform might be more meaningful.

Remote Info uses an ID and a Derivation ID - any blank fields are considered filled in by the Derivation ID's row (recursively).
It uses SDK constant names for KEY headers and my V49 constants for newer keys. I actually parse those to get the key code in Java.

Key labels are vertical-bar separated Label|Icon
Labels are meant to be literal text used on the remote (like "Ch" not "Channel up")
For colored buttons, I'm using the 4 action buttons as generic colored icons, except ones with a color AND an icon. All button text is in the Label part, regardless of how it is attached to the icon.
If the Label falls below the icon on the remote, the Label starts with "\n" (backslash, n - not an actual newline), or if above, it ENDS with "\n". Otherwise the label is centered over a generic button image.
Note, I didn't take the time to apply the "\n"s per button when the button is a generic button. I.E. I didn't differentiate between a button with "info" written on the face of it vs. a button with "info" written on the remote above/below the blank button. Feel free to fix those, but I this is as good as or better than TiVo does.
(It needs to also include label\nlabel2 for buttons with part of the label above and part below the button/icon)


----------



## dvdvids

How to remove the remote apps from tivo?
I had added (Enter Webz! via) 212.1.209.140 to test it out... it looks very promising indeed!
Now, I want to add it via a local version of Enter Webz! server.
Before that I want to remove the already added remote IP for Enter Webz!

Thanks!


----------



## davidblackledge

dvdvids said:


> How to remove the remote apps from tivo?
> I had added (Enter Webz! via) 212.1.209.140 to test it out... it looks very promising indeed!
> Now, I want to add it via a local version of Enter Webz! server.
> Before that I want to remove the already added remote IP for Enter Webz!
> 
> Thanks!


The short answer: instead of pressing "Select" on one of the App entries, press "Clear" and the IP will be removed.

HOWEVER - I recommend instead just editing your Apps group in the Enter Webz thumztaks to move everything you don't want listed out of the Apps group. Maybe just keep a weather page or something. 
Why? Because the server will "always" be available but your local copy is only if you have it running, and the server also runs Solitaire and Mahjongg and more stuff in the future.

Running both your local version and the IP server at the same time is perfectly safe. That way you can maintain more security and privacy for sensitive pages using your local version, but always have access to simple pages.


----------



## dvdvids

davidblackledge said:


> The short answer: instead of pressing "Select" on one of the App entries, press "Clear" and the IP will be removed.
> 
> HOWEVER - I recommend instead just editing your Apps group in the Enter Webz thumztaks to move everything you don't want listed out of the Apps group. Maybe just keep a weather page or something.
> Why? Because the server will "always" be available but your local copy is only if you have it running, and the server also runs Solitaire and Mahjongg and more stuff in the future.
> 
> Running both your local version and the IP server at the same time is perfectly safe. That way you can maintain more security and privacy for sensitive pages using your local version, but always have access to simple pages.


cool...thanks!
I just want to play with the local one 
So, I will try to use both (games from your server) others locally.

BTW, could not get WatchESPN to play video! Able to open the site, but cannot select the stream... any specific reason?


----------



## davidblackledge

dvdvids said:


> BTW, could not get WatchESPN to play video! Able to open the site, but cannot select the stream... any specific reason?


Could you give me more information? I don't think I was able to find what you're talking about.
Could you please 
a) give me a URL to try and 
b) describe your steps and what happens? (e.g. "There doesn't seem to be a link to click" or "When I click the link 'blah blah' nothing happens" or "When I click 'blah blah', the video player complains 'xxx xxx xxx'")

I think I can register an account with WatchESPN through my cable provider to try it out, if that's a necessary step.

I know in general, the ESPN mobile site doesn't provide any links to video content at all, just podcasts (which work) and articles and scores.

I tried it on a regular browser, and there is a lot of JavaScript on that site, so it may not work right due to that, but I did notice the use of a VIDEO tag which is a good sign that Enter Webz might be able to make it work.

_Also, to improve compatibility, I'm going to add some more Mobile modes that should cause some websites to provide different content. But that starts getting hairy...I'll may have to make thumztaks store the mode with the URL because you'll need different modes for different sites to work._


----------



## dvdvids

davidblackledge said:


> Could you give me more information? I don't think I was able to find what you're talking about.
> Could you please
> a) give me a URL to try and -- *espn.go.com/watchespn*
> b) describe your steps and what happens? (e.g. "There doesn't seem to be a link to click" or "When I click the link 'blah blah' nothing happens" or "When I click 'blah blah', the video player complains 'xxx xxx xxx'") -- *(It is a live streaming site and also give access to recorded live events)
> Via Enter Webz, I do not see the links on the page (wish I could do screenshots)*
> 
> I think I can register an account with WatchESPN through my cable provider to try it out, if that's a necessary step. -- *It does need cable access for some of their streams*
> 
> I know in general, the ESPN mobile site doesn't provide any links to video content at all, just podcasts (which work) and articles and scores. --*Is Enter Webz designed to work only with mobile web apps? This espn site is a regular site, not sure if there is a mobile url.
> Also, on a side note, I watch live streams from sites like hahasports, how does Enter Webz handle ads? (adblock takes care of them on mozilla/chrome) *
> 
> I tried it on a regular browser, and there is a lot of JavaScript on that site, so it may not work right due to that, but I did notice the use of a VIDEO tag which is a good sign that Enter Webz might be able to make it work.
> 
> _Also, to improve compatibility, I'm going to add some more Mobile modes that should cause some websites to provide different content. But that starts getting hairy...I'll may have to make thumztaks store the mode with the URL because you'll need different modes for different sites to work._


...added comments in *bold*


----------



## davidblackledge

dvdvids said:


> espn.go.com/watchespn
> 
> (It is a live streaming site and also give access to recorded live events)
> Via Enter Webz, I do not see the links on the page (wish I could do screenshots)
> 
> It does need cable access for some of their streams
> 
> I know in general, the ESPN mobile site doesn't provide any links to video content at all, just podcasts (which work) and articles and scores. --Is Enter Webz designed to work only with mobile web apps? This espn site is a regular site, not sure if there is a mobile url.


Ah, ok, I was at the right site, then. That's a JavaScript-heavy site, and Enter Webz doesn't support JavaScript or flash or other highly-interactive technologies. EW can barely handle the images ;]
In this case, it looks like the content, including the links, is designed to mostly load dynamically, which EW doesn't support.

Available in the Sports & Weather group under Apps in the default setup for EW, there is a mobile ESPN site link. It actually is a very well done mobile site, but it specifically doesn't include any video content.

It's too bad, too, because I think the non-live videos on that site might actually work if there was a simple link to them.

While EW isn't Mobile-specific, it's not able to handle lots of images or fancy content, so mobile sites work much better since they're designed to be much simpler.



> Also, on a side note, I watch live streams from sites like hahasports, how does Enter Webz handle ads? (adblock takes care of them on mozilla/chrome)


Well, if the ad is dynamic (JavaScript/flash) content, then Enter Webz can't display it. If it's just an image/link, it works fine. If it's an IFRAME (often they are) Enter Webz doesn't (currently) support them except by making them into a new link to the IFRAME's page.
Enter Webz doesn't actively try to block any advertising.


----------



## dvdvids

cool.. gotcha.. it's a light weight browser and at this initial stages shows a huge potential.. :up:
hopefully, tivo takes this and build on it to make a heavy weight browser! 

Is there a way to zoom web page? ..found it hard to see some of navigation icons

Mouse or Wii like remote would make the navigation so easy.. so is there any way to connect a mouse to tivo box directly or via bluetooth/wireless adapter?


----------



## davidblackledge

dvdvids said:


> cool.. gotcha.. it's a light weight browser and at this initial stages shows a huge potential.. :up:
> hopefully, tivo takes this and build on it to make a heavy weight browser!


Unfortunately, it doesn't have a whole lot further to go from these "initial stages" except for possibly a complete rewrite of one section to use the "CSSBox" library that will do page layout way more accurately, and maybe add support for borders. 
And I have to figure out what's wrong with Cookies ... I guess it doesn't follow the standards 100%, so Google products break eventually.

However, I'm perfectly happy to sell if TiVo is buying ;] I'll move on to games or something.

But, as you may have heard, TiVo already has a heavy weight browser (Opera) on Premiere and Roamio, but they haven't provided general browsing access with it (and may never), but instead use it for HTML5-based one-page apps. At least my app also works on Series 3 (and Series 2, I believe... but only 1 has used EnterWebz.tv so far)


> Is there a way to zoom web page? ..found it hard to see some of navigation icons


Well, you can change the TEXT size temporarily with 1-9 (or "info" menu to do it permanently) - but that doesn't affect image sizes. 
I could definitely add zooming fairly easily, but it would be either a literal zoom, causing you to scroll left/right a bunch, or I could do it with re-load of the page like it does when you change font size or mode. 
Either way I'd have to figure out how you activate it...I've pretty much run out of buttons except "A" and "C" on the newer remotes.

However, you said "navigation icons"...if you mean the hints on the left side, I noticed that the text is a little too small on one of my TVs, too. I'll play with a larger size for that, especially on HD TVs.


> Mouse or Wii like remote would make the navigation so easy.. so is there any way to connect a mouse to tivo box directly or via bluetooth/wireless adapter?


Nope, sorry... TiVo doesn't support that. HOWEVER it does support the SLIDE remotes with keyboards, and if you don't have that remote, you can plug a USB keyboard into the USB port in the back (wireless ones even work). That will let you type directly on text fields, etc. and USB is more responsive for arrow keys, etc., than the infrared remotes. 
One other improvement I need to do is write custom handling for the "link focus" stuff - so you don't end up going in circles around the link you want to get to, and so the focus is a "floating" visual that's easier to spot as it slides to the next link.


----------



## davidblackledge

There are now 220 TiVo DVRs that have subscribed to EnterWebz.tv... but I'm getting very little feedback...so I'm just changing things I feel like changing before the official release.

PLEASE let me know if you feel something needs a change. I've documented a few TODO items on the Google Docs documentation page, but anything else is not a priority to me unless YOU say something.

And again, anybody that would like to add to the TiVo Model Information and Remote Information Google Docs I mentioned a few posts back, that will help EWz and anybody else that chooses to use it. Eventually I may add a menu option to select a remote (via a picture) to further customize your experience.

Both EWz download and EnterWebz.tv have been updated today.

The download at David.Blackledge.com includes the February server update as well as this update.

Most notable is an update to the User Agent string... several changes (including reporting "beta 0.9"), but you can now select a mobile emulation mode from a long list in the Info menu. The default is now Samsung, not the old AvantGo I was using. Samsung works well on the majority of websites.
I believe this fixes *Yahoo login* issues. It also fixes some issues with *Google pages*, but doesn't fix the cookie going bad after a few weeks. *Facebook *stopped working recently for me...this fixes that, too.
There is an iPad mode, but since EWz doesn't support scripting, it's probably not great choice unless you're looking for a *better page to get a Video*.

A known problem with requests for non-html support files (e.g. CSS stylesheets) is fixed now so a lot of pages that weren't formatting right will work well now. 
One of those is *video.pbs.org *which I highly recommend you save a link to... full episodes available for streaming with EWz.

HME server TiVoConnect links will automatically format as a web page so you can see everything served as a list. See the "recommended links" page for TiVoConnect links for known HME servers. 
Of interest is TiVo's which oddly will *launch the NON-HME app *for one of the Netflix and one of the Youtube entries. I hope we can find out the secret to that trick for our own purposes.

Also, the thumztak Edit screen is accessible from the Info menu now, not just the "enter" key shortcut.

By the way... the Shoutcast page doesn't work anymore with the recent buy-out (too JavaScript heavy), so as previously suggested, please add mobile.internet-radio.com as a link and you'll be back in business again.

Finally, I've added a little more logging so I can get some idea of how people are using it since nobody's saying anything.

Tell me what your experiences are! Let me improve it!


----------



## davidblackledge

davidblackledge said:


> Most notable is an update to the User Agent string... several changes (including reporting "beta 0.9"), but you can now select a mobile emulation mode from a long list in the Info menu. The default is now Samsung, not the old AvantGo I was using. Samsung works well on the majority of websites.


Ooops...  I left a test mode in that distribution that forced you to always use PALM mode. 
Updated the http://EnterWebz.tv server just now to default to SAMSUNG and to actually use your selected mode, whatever it is. (Not updating the download right now unless somebody asks)

Noticably, Youtube uses tiny thumbnails for SAMSUNG and enables numeric shortcuts, while PALM uses larger thumbnails and doesn't indicate any numeric shortcuts.

Please check my Key TODO list in the documentation and if you want something to change but it isn't here, Please let me know!


----------



## jgametest

Well I have not received the update that all are experiencing trouble on yet. So guess that's good for now, will take a look at the new changes you rolled out as soon as my kids fall asleep they are hogging the TiVo so I'm using my notebook / phone for temp access. Keep up the great work!


----------



## davidblackledge

Ok, one more update this weekend.

I made it possible for me to update the default apps.

Next time you look at the list, you'll see things like a replacement for the broken Shoutcast link, a new set of PBS video links, more comics, removal of some broken items like Twitter, and a new NOTICE link that you can delete, and I will re-add when there is a new notice. Solitaire, Freecell, and Mahjongg are now just links, too, so you can move/delete them if you like.

Several apps were also reorganized, and there is a new permanent entry to access the App list for editing - it's visible on both the Music/Photos and Video/Other lists.

Check out the NOTICE for more details.

If you saved your own link that differs from the default URL, it won't be altered by the update.


----------



## davidblackledge

I believe I found out why Google/Youtube tend to think that EnterWebz.tv is in Spain. 
Since most User Agent strings include an operating system model/version string, I include "TiVo/22.1.2.3.3" or whatever version your TiVo is reporting. Google is trying to be "too smart" and thinks that because there is a city named "Tivo" in Spain, I must be reporting a location, not software information. 
I will change the string to "TiVoDVR/version" (or maybe TiVoOS/version?) and I'll probably take advantage of this quirk and add TiVo's Device-reported location to the User-Agent and/or to another Header. It's kind of imprecise location information (mine reports a small town 233 miles away from me), but much better than assuming all subscribers are located where my server is. Recently added language information in the same style is probably fixing Youtube/etc stuff already, though.

I've also run into some irritating inconsistencies in the newly-added PBS pages. The actual episode launching page can come up in one of three states. This looks as though it's driven by your mobile mode selection, but it can get stuck in one state regardless of your selection. 
It can show up 1) with default "VIDEO" tag handling that shows little film strip icons provided by EWz which you click to start the video, it can show up 2) with one-pixel "images" you may click to start the video, or 3) the one it gets stuck on for me which has nothing available to start the video. 
I've gotten some web tools to investigate this strange PBS website behavior and will try to figure the best solution, if there is one. So far it seems to give the tool one of two consistent results with different modes, and doesn't get stuck

Finally, I added some Google Docs graphs of the EnterWebz.tv history to the "statistics" page at the website. (Oddly, they won't appear from within EWz. I'm guessing the TiVo isn't recognizing the strange URL as an image... maybe I'm not doing the necessary additional handling because I've provided size information already - if I can fix that, it might fix a bunch of other images in EWz.)


----------



## Allanon

Davidblackledge, you might want to change the User Agent to one used by a mobile device, that way you will get mobile webpages which usually have less Java and Flash. Plus smaller images.

For example this is what the mobile version of IMDB looks like:
http://m.imdb.com/title/tt0411008


----------



## davidblackledge

Allanon said:


> Davidblackledge, you might want to change the User Agent to one used by a mobile device, that way you will get mobile webpages which usually have less Java and Flash. Plus smaller images.
> 
> For example this is what the mobile version of IMDB looks like:
> http://m.imdb.com/title/tt0411008


Thanks Allanon. Actually EWz has been using a mobile UA by default (based on AvantGo) since the beginning, and has been using the m.imdb.com since the beginning. When you see that page in EWz, though, it's very limited because it uses a lot of JavaScript to fill in content.

And in the last major update here, all 8 UAs I made available are all mobile ones as well. 
They each have dramatic differences in how e.g. Youtube is represented. 
Either Palm or Samsung seems to be the most compatible results with EWz, but some sites only make an MP4 available for iPad mode, I think.

PBS seems to give MP4 to several mobile UAs...but it gets STUCK either providing or not providing MP4 no matter how you change your UA after that. This is happening even with a web tool I'm using to test the site. I think they must store the decision in a cookie and never check again after that.


----------



## davidblackledge

Ok, finally released another update both for download and on the public server.

*BONUS* it includes some new HME apps: Airnow.gov Air Quality Index map forecast/history browser (in Apps/Sports&Weather), and a Minesweeper clone (in Apps/More/Games). Both are kind of thrown together just for fun. Not 100% clean presentation.
*Easter Egg* of sorts: It also includes the Multiplayer Cribbage game I'm working on (only about 75-85% complete). Your challenge: figure out how to launch it (and then have another TiVo launch it, too, to play against them)... it's the first attempt with a multiplayer architecture I'm setting up so I can do a bunch of stuff in the near future.

Enter Webz itself: 

Changed hints to only generate once, not once per web page - this should save some memory during your session.
Made the keyboard a little more understandable.
Also added a Remote Picker support HME app. You can pick your remote from the EWz "info" menu. It changes how help hints display.
Improved Video tag strange cases like PBS uses (1x1px size), so if you get a working PBS page, you'll get "normal" Video tag icons to launch videos.

--------
On the technical side...

1) something in the network route between my neighborhood and the enterwebz.tv keeps dropping packets so a lot of the time I can't connect to my own server now :/ No problems tonight at least.

2) Recently almost zero videos will play for me (except youtube, and one extremly low quality small sample video)... I don't know if this is just a temporary thing, a problem with my DVR, or if TiVo somehow locked down their VideoPlayer app I use. Do non-youtube videos work for you still from EWz?

3) for me, the PBS pages are stuck in the "bad" mode where I don't get a video tag sent to me at all. Anyone have a working page?

4) Attempting to do multiplayer stuff with the 1.4.1e experimental "thread safe" SDK, I learned that they made it so "thread safe" that it's a brick now. In reality it's one giant synchronized block. There is like one line outside of the synchronization, and it doesn't yield the thread, I guess. (all of handleChunk (which is the origin of ALL 3rd party code execution) is in the synchronized block, and getting the next chunk is not). So instead I use the Factory as a central data source and use sendEvent to poll it for changes.

Please post your experiences or suggestions!


----------



## jgametest

I tried the PBS videos, I saw the links for each area and loaded the link was presented with pictures and descriptions of the video but upon clicking it it's like a pulse to my TiVo and then returns back to the description. Is there a process to get the videos to load that I'm missing.


----------



## davidblackledge

jgametest said:


> I tried the PBS videos, I saw the links for each area and loaded the link was presented with pictures and descriptions of the video but upon clicking it it's like a pulse to my TiVo and then returns back to the description. Is there a process to get the videos to load that I'm missing.


Thanks for trying it! I'm glad you at least got video links (they probably showed up as "filmstrip" icons, right?)
You're not doing anything wrong, but the result is surprising.

The video troubles I was having show in a "incompatible format" message screen from the TiVo Video Player. I HAVE gotten SOME videos to work for me, just not the ones that usually work.
It sounds like yours is failing before even trying. Perhaps try a few different PBS shows to see if all of them fail. 
I'd also be curious if you can play any of the archive.org videos.

It FEELS like EWz can't find your Video Player app, but I'd expect to see something in the logs if that was it... oh...wait... I just checked... it doesn't log anything if that happens... you'd just hear a Bonk. I sabotaged myself ;]

I'll get that logging fixed up ASAP.

But much more interesting to try... start EWz and go to "More/"
Select "[Enter Webz suggested links]"
Scroll down to the "Servers" section
Select the link in "TiVo's applications (at 204.176.49.116)"
This shows a page of all the apps that TiVo is showing to your DVR.
Can you see one called "VideoPlayer" in that list?

There should be one listed... but it's behaving like there isn't one.


----------



## davidblackledge

davidblackledge said:


> It FEELS like EWz can't find your Video Player app, but I'd expect to see something in the logs if that was it... oh...wait... I just checked... it doesn't log anything if that happens... you'd just hear a Bonk. I sabotaged myself ;]
> 
> I'll get that logging fixed up ASAP.


Jgametest - try it again... I think I should get something useful in my logs if it fails, now.


----------



## davidblackledge

davidblackledge said:


> 2) Recently almost zero videos will play for me (except youtube, and one extremly low quality small sample video)... I don't know if this is just a temporary thing, a problem with my DVR, or if TiVo somehow locked down their VideoPlayer app I use. Do non-youtube videos work for you still from EWz?


Fixed finally... I "missed a spot" regarding the issue that the TiVo can't handle https URLs. I was allowing https to go to the videoplayer, and I guess archive.org must have recently changed their redirects to not use http.

... I really need to update the wiki with more of this stuff I've learned.


----------



## davidblackledge

Today's EWz update:

 :up: Added custom blitzortung.org *Lightning map browser* thumztak (clone of my airnow.gov *Air Quality map browser*) in "News, Sports, & Weather/"
  Rearranged thumztaks to consolidate top level to only 2 groups and 1 regular app (Internet Radio) under music & photos, and 4 groups and 2 regular apps (YouTube and Cribbage) under video & apps. (You can always move your favorites to the top Apps/ group if you like).
 :up: Added *more video, audio, photo, news, social, etc.* thumztaks. (I especially like the "stock footage")
 :down: Removed no-longer-compatible flickr thumztak and silly "card trick" one.
  Updated icons to make wmcbrine happy (no more *purple outline*, but uses the trick still for groups) and with a prettier default (not the "EW" stuff).
 Saving a thumztak now places it in the _last-used_ group (not the top level above Apps/).
 Some improvements in Image handling (especially in displaying errors)
I probably won't do any more bulk rearranging. I'll just add new or replace/delete broken ones and rotate old games to "Games & More/" when I add new games at the top Apps/

BTW - Hey! anybody! Does the PBS content work for you!?!?!?


----------



## davidblackledge

I know I'm just talking to myself since nobody will even complain about it, much less say something is working or ask for additions, but...

Changed from standard Bananas "whisper arrows" to a custom link highlighter.
Automatically inserts a "submit" button for forms that don't have one

The custom link highlighter also modifies behavior so adjacent links (images, and font style changes that I have to break up into multiple links) are treated as a single link.
I need to improve its visibility a little, but it's still better than the whisper arrows.

The automatic "submit" button fixes pages that use a form with a single text field that automatically submits when you hit "return" in a real web browser. It also can work for JavaScript-submitted forms.
As I'm writing this, I realize an exception I made for forms that have only a SELECT field shouldn't be there - those are frequently submitted with JavaScript and this would have fixed those. I'll change that for next time.
Right now it's a small default "submit" button - I'll probably change it to a custom "obviously an EWz special button" display in the future.

Again I'll ask: *can somebody tell me yes or no if PBS episode streaming works for you?* It's a no for me, but it SHOULD be a yes for some people.

I'm about out of steam on this beta stuff and will do the *official 1.0 announcement soon* (I'll update the download then, too). 
_*Please let me know if there is something that needs to change before the "grand opening."*_

I'm hoping I can get Zatz to check it out, but no response yet on an email last week. Just another "I'm talking to myself" example.

I'd appreciate even hearing somebody say "this is crap, why would you do this?"... better than silence.
Oh yeah... number of subscribed TiVo DVRs broke 300 this week.


----------



## Fofer

I just set up Webz on my TiVo Premiere, via the IP address, and it's looking pretty cool! I'm enjoying what I am seeing so far. I listened to some internet radio, checked out a few web pages. I was unable to get a PBS video to stream, though. I'm still poking around and seeing what Webz can do for me.

Thanks for making it, davidblackledge! This is awesome. I feel like I just upgraded my TiVo with cool new functionality, and all it took was a few seconds to set up.


----------



## davidblackledge

Fofer said:


> I just set up Webz on my TiVo Premiere, via the IP address, and it's looking pretty cool! I'm enjoying what I am seeing so far. I listened to some internet radio, checked out a few web pages. I was unable to get a PBS video to stream, though. I'm still poking around and seeing what Webz can do for me.
> 
> Thanks for making it, davidblackledge! This is awesome. I feel like I just upgraded my TiVo with cool new functionality, and all it took was a few seconds to set up.


Thanks for posting, Fofer!

I just tried my best available theory on the PBS Video stuff (clear all cookies and change device type and try again) but none of my attempts got any better result... very strange. I know it's POSSIBLE for the PBS pages to provide a basic "VIDEO" tag, but it's so resistant to cooperating. If I can't figure it out before the "launch" I'll remove all the PBS pages (same as I did with Twitter) until I can find a fix... unless somebody posts that they're having success.


----------



## m.milhofer

Hi
I recently got a TiVo box through VirginMedia
I haven't worked out if you are UK based or not so that may not mean anything to you!
I found this forum because I was looking for a way to browse via TiVo
I work with computers so am not daunted by the technical side of things but.. How do you 'install' stuff on a TiVo? I have no idea. Is it possible that my TiVo is different because it comes from a TV/broadband provider?
Anyway, you all sound very helpful and friendly on this site, if someone can help me out then great, if not, I've enjoyed reading you all!
Manfred


----------



## davidblackledge

m.milhofer said:


> Hi
> I recently got a TiVo box through VirginMedia
> I haven't worked out if you are UK based or not so that may not mean anything to you!
> I found this forum because I was looking for a way to browse via TiVo
> I work with computers so am not daunted by the technical side of things but.. How do you 'install' stuff on a TiVo? I have no idea. Is it possible that my TiVo is different because it comes from a TV/broadband provider?
> Anyway, you all sound very helpful and friendly on this site, if someone can help me out then great, if not, I've enjoyed reading you all!
> Manfred


Thanks for your interest!
I don't know a lot about VM TiVos, but I'm fairly confident you can't add 3rd part content on them. By "on them" I mean "visible to them" as you don't actually install software on the TiVo, it's more of a client/server setup where the real work is done on another computer, and the TiVo is knows how to display stuff and play videos.

There are two ways to get 3rd party apps on TiVos that support it: 
First is software installed on a computer on the same home network as the TiVo which normally "announces" the list of apps with a bonjour-style protocol. This is generally the "downloads" you can find on the Internet for TiVos.
Second is software installed on a server on the Internet. In that case you have to select the "Add an App" option under the Apps section of the TiVo and enter the IP address of the server. I'm pretty sure VM TiVos don't have an "Add an App" option.
I also don't think VM TiVos support the bonjour app announcements.

Note that the 3rd party apps are a separate concept from the programs that serve your household music, photos, and videos ("devices") as just a listing using the "HMO" protocol. The apps that display those entries are built in to the TiVo. I don't think VM TiVos support that concept, either.

I don't really KNOW whether any of that is supported by VM TiVos, but I have yet to hear anyone say they're using those features with one of those models.


----------



## m.milhofer

Thanks David I will look at getting my PC and TiVo communicating on the home network first
Manfred


----------



## jmbach

Decided to try this out. Looks pretty cool. Went to PBS.org web page and clicked on something and my Premiere running 20.4.2 rebooted.

Tried to stream PBS and could not stream. Got what looks like something that would control the video. I would click on it and a blank pick list would appear. I could scroll down and select it but could not see anything.

On an ESPN video, I got that the TiVo could not display this video error because of incompatible format.


----------



## jmbach

Interesting problem I have. Was playing around changing different emulations. Changed to AVANTGO and now it is greyed out and cannot change it to anything else. Also the info in the bottom left corner of the screen does not show the emulation mode just font size. I cannot seem to reset it. I deleted the app and reinstall but it kept all the same settings. Clearing cookies did not do anything either.


----------



## davidblackledge

jmbach said:


> Decided to try this out. Looks pretty cool. Went to PBS.org web page and clicked on something and my Premiere running 20.4.2 rebooted.
> 
> Tried to stream PBS and could not stream. Got what looks like something that would control the video. I would click on it and a blank pick list would appear. I could scroll down and select it but could not see anything.
> 
> On an ESPN video, I got that the TiVo could not display this video error because of incompatible format.


Thanks for letting me know your experience, this really helps!

Reboot: I might just have to remove (or at least hide) the "enter a url" feature for the 1.0 launch. Pages I didn't pre-select have a high likelihood of rebooting by having complex combinations of images that HME doesn't handle gracefully.

I have some ideas to reduce failures when you're browsing pages for a while, but it likely won't help a case like you encountered. Without pre-processing every page for safety while you sit and wait for it, I can't protect against TiVo's HME bugs. It is tempting to have a "no images" mode that should make things pretty safe, but so many pages will not make sense without the images... and I don't want to maintain a list of "safe for images" pages but how else do I allow images in some cases but not others? It's a whole level of app complexity to add. I want to keep this thing simple to use, but there is nothing simple about the unrestricted Internet ;]

I guess it's not looking good for PBS video streams... very strange because I added those pages originally because I had it working for a while. If it was working you'd get a "filmstrip" default video icon instead of the blank pick list. That's the strangest website that it won't cooperate most of the time. I might even try to contact them to see what's going on.

ESPN video: too bad. TiVo has a very limited subset of video formats it supports. Anything that comes across as "this is video" EWz sends to the Video Player and hopes for the best. If it failed then either 1) it's not in the subset that TiVo can handle or 2) it is an "https"-only link and the HME is too dumb to handle secure media links (I tell it to drop the "s" and usually it works, but some places it doesn't)
I wish I could better determine this ahead of time so it's not such a surprise to the user.

One thing I've been thinking is to "claim" that every video I send to the player is a supported format in case the player is having trouble figuring it out... some links have weird filenames or video types that might look wrong to the player but would actually work. This is just a theory, though.

Thanks again! let's hear some more!


----------



## davidblackledge

jmbach said:


> Interesting problem I have. Was playing around changing different emulations. Changed to AVANTGO and now it is greyed out and cannot change it to anything else. Also the info in the bottom left corner of the screen does not show the emulation mode just font size. I cannot seem to reset it. I deleted the app and reinstall but it kept all the same settings. Clearing cookies did not do anything either.


Greyed out emulation should only mean you're not in mobile mode... if that's not checked, then that's why it's greyed out. If you click "mobile mode" again (or click the "zoom" button on a web page) it toggles that mode on and off.

That reminds me...I introduced a bug in the "info" menu when I changed the highlight cursor for web pages... it doesn't highlight the two pick lists at all in that menu now.


----------



## jmbach

I'll have to check when I get home. Thought I tried to toggle that on the menu. The other thing, and maybe I just did not pay attention, the emulation mode and screen type are not highlighted to know which one you are on. So if that is what you are referring to as your bug, then I agree. 

As far as images. Could you have just an image placeholder for unrecognized formats. Then maybe navigate to the placeholder and hit a button to toggle it on?


----------



## jmbach

Another idea but it might be something that one would have to implement locally is what about on the fly transcoding like kmttg.


----------



## jmbach

The other thing that might be nice is when you are on that menu, once you make one choice it goes back to the main screen. Maybe I am doing something wrong. Would be nice to make several changes and the go back to the main screen.


----------



## davidblackledge

jmbach said:


> The other thing that might be nice is when you are on that menu, once you make one choice it goes back to the main screen. Maybe I am doing something wrong. Would be nice to make several changes and the go back to the main screen.


Good point. The current style is from when there were like two options, but now that there are a bunch of related options, waiting would make more sense.


----------



## davidblackledge

jmbach said:


> Another idea but it might be something that one would have to implement locally is what about on the fly transcoding like kmttg.


Not gonna happen. One of my principles here is to keep it simple...whatever the TiVo can do, EWz can do, but I don't want to download streams to my server to transcode for an upload to the TiVo.

HOWEVER, I've thought I could integrate launching of other apps (like the video player for "understood" videos and youtube and my app to pick your remote control model)... I'd love to come up with a scheme for identifying locally installed apps for that.

So, after installing e.g. KMTTG on their home computer, user would "configure" EWz to identify "192.168.0.5:7288/kmttg" as the kmttg transcoding video player, then EWz would launch THAT instead of the regular video player, and your local KMTTG would do the heavy lifting that I don't want to do on my public server.

I could even do that with images (that wouldn't even be an HME app, just an image proxy program installed on your home computer that transcodes images to not crash HME). In fact, a simple proxy would fix all the https-related failures and could even be set up to send referer and maybe cookie information that some servers require but TiVo doesn't send. I might just write that when I have some time

_(I'm naming KMTTG at random...I don't have most of these things installed myself, unfortunately, so I don't know what would work here... I fear none of them are set up to accept a video URL as an HME transition argument, though)_


----------



## jmbach

When you make it I'll test it.


----------



## dadrepus

Could this be used to activate and display plex within Tivo? Plex has a web client as well.


----------



## davidblackledge

dadrepus said:


> Could this be used to activate and display plex within Tivo? Plex has a web client as well.


I haven't been following that thread too closely, but as I understand it there needs to be a launch of the TiVo's internal web browser or of an Opera app... neither of which does anybody know how to do from HME, yet.

Enter Webz is pure HME, so the short answer is "no, not yet."

We may figure out how to do such a launch eventually, but I don't think anybody is working on it.

Enter Webz can only display "downloadable" videos.

That said... Plex at some level may be downloadable, so with some effort it might be possible, but it looks like most Plex stuff is javascript-dependent, and Enter Webz doesn't do javascript, so that increases the amount of effort.

I've got a lot I want to do with EWz, and not much free time for it, so I don't know when I'd get to investigate that.


----------



## davidblackledge

FYI, I've worked some on the media proxy idea, but it's a little more complicated than I thought... animated GIFs, streaming audio, etc are problematic, so I've had to temporarily shelve it while I work on other stuff, but I've got the hooks in place on EWz for whenever I do get it done (or somebody else does!).

new release post next.


----------



## davidblackledge

Almost 3 months since I put out an update, so here's what I've been working on:

*PBS Video* works now - I generalized Video link display and launching so I can add more custom handlers and added one for PBS. (if you removed the non-working PBS pages, you can re-add them from the default links page http://enterwebz.tv/default_links.html) Also added one to help with the "embed.ly" style now used for some youtube, etc.
fixed some features to support a *slideshow *concept I'd always envisioned. Added my own page for one that starts a radio station, then starts a random slideshow of Flickr images. Auto-refresh pages now shouldn't "dim" when idle. (also a non-music one you can start after you start your own music)
Menu lets you change more than one thing at a time - per jmbach's suggestion
Menu has advanced options only on request, now.
Support for locally-installed *Media fixing proxy* and locally-installed *Transcoding Video Player* (these programs do not exist yet, though, sorry)
Text entry pages now include a helpful title.
Remote picker will save your choice again.
Using JSoup 1.8.1 with some speedups and better support for XML/RSS sites.
UPDATED THE *DOWNLOADABLE VERSION* finally.. been about 6 months.

Not technically 1.0 release yet, but that should happen within a month.

In theory I can support more video downloads much more easily now... vine is still a problem because they only work with https, but maybe I can spend some effort and get Vimeo working again.

The PBS custom handler is using the PBS "json" data to get everything (title, subtitle, description, rating), but I'm just using a RegEx to parse it - too lazy to get a json library - so apostrophes aren't showing up right.

The Media Proxy I already posted about... works for basic images, but other content is trouble, currently, so not offering it, yet. 
Anybody have experience doing a straight pass-through stream proxy? I'd like to point the TiVo at the http proxy url and have it appear to be an https stream it connects to.
The Video App setting is waiting for somebody to make a transcoding video stream player that has the same interface as the TiVo video player (hopefully wmcbrine and HME/VLC... FYI, wmcbrine, the mime argument shows up with the arg name "mime")

*Let me know if you have any questions, comments, suggestions, stories, or website recommendations!*


----------



## Axter

I just tried this Webz for the first time with the 2014-11-28 EnterWebz beta distribution version, and it's not working.

I can see "Enter\032Webz" listed on Tivo.
When I click on it, I do get the main Webz menu.
However, when I try selecting any site on the menu, Tivo immediately displays an error message "App Temporally Unavailable" (V301).

No matter what site I enter into Webz, as soon as I click select button, it jumps to that Tivo error message.

I'm trying this from a Tivo Premiere box, and on my Windows machine I have disable the firewall to make sure that wasn't the issue.

Has the Webz been tested with Tivo Premiere?
What Tivo box do you normally test it with?

FYI: This sounds like a great app, if I can get it to work.


----------



## Axter

Here's the errors I get on the Windows machine when clicking on a website on Tivo:


> LOG: null
> *** new cookiestore! ***
> LOG: unknown event opcode : 10
> 7582001903D5BCC [email protected]:45:50 /webz/ start:null( com.tivo.core.ds
> [email protected]{zoneinfo=America/New_York, com.tivo.examine.idType.s
> tationId=tivo, platform=Gen07, host=Maisonave3, has-recording-capability=true, a
> ctive-ui-mode=flash, has-season-pass-capability=true, credential-manager-id-mac=
> 44E08E8FAAC1, vod-session-capable=false, version=20.4.5c-01-2-758, country=US, h
> as-recording-storage=true, credential-manager-id-ccid=498FAAC1, brand=TiVo, lang
> uage=enUS, com.tivo.examine.idType.contentId=tivo, com.tivo.examine.showing=true
> } )
> java.lang.IllegalArgumentException: No enum const class com.blackledge.david.tiv
> o.TiVoModelInfo$SERIES.??
> 7582001903D5BCC [email protected]:45:56
> LOG: connection to receiver closed
> 7582001903D5BCC [email protected]:45:56 /webz/ end:CRASH( 0.09 mins
> dirtyExit bookmarks: null )
> LOG: Unexpected error: java.lang.ExceptionInInitializerError


----------



## davidblackledge

Axter said:


> I just tried this Webz for the first time with the 2014-11-28 EnterWebz beta distribution version, and it's not working.





Axter said:


> Here's the errors I get on the Windows machine when clicking on a website on Tivo:


First, thanks for trying it!

Hmm... all of that is normal except the "LOG: Unexpected error: java.lang.ExceptionInInitializerError" at the end.
I just cleaned out my local copy completely and tried it with my Premiere just to be sure, and had no problems. I also have a TiVo HD I test it with.

However, I don't see the first few lines in your output which would be something like:


Code:


JAVA_HOME: "C:\Program Files\Java\jre1.8.0_25"
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
MDNS: http://192.168.0.20:7288/webz/

I suspect the version of java it is finding to run on your computer is less than 1.5
If that's the case, get a newer version of Java, and if it still doesn't use that newer version (or you already have a newer version installed) set the System variable "JAVA_HOME" to point to the newer version.

If that still doesn't fix it (or you need more detail) let me know and I'll look into it some more.

By the way, I forgot to mention that I released that download copy with a rather bare "launcher.txt" file...open it up and edit it to have more interesting listings at the top level of your TiVo (the \032 stuff is a bug in the Premiere and above HD (Flash) UI...they're not following their own standard).

And don't forget you can use EnterWebz.tv to try it out, too.

Please post again with any other experiences you have or comments!


----------



## wmcbrine

davidblackledge said:


> (the \032 stuff is a bug in the Premiere and above HD (Flash) UI...they're not following their own standard).


I've worked around this by replacing spaces with the non-breaking space character (A0h).


----------



## davidblackledge

wmcbrine said:


> I've worked around this by replacing spaces with the non-breaking space character (A0h).


Excellent, thank you. I'm adding it to the wiki, and I put a fix in my copy of V49BApplicationFactory in the setAppTitle and getAppTitle methods.


----------



## davidblackledge

I finally pulled the trigger on Enter Webz 1.0
See the new thread in TiVo Coffee House.
I'm also considering adding a new TCF thread in "TiVo Home Media Features & TiVoToGo" for the downloaded version. 
I intend to abandon this thread.

As part of this release I have changed the server for EnterWebz.tv
_I made this change due to the Hosting24 server's inability to connect to twitter.com, some occasional connection issues between my home and the server, inability to upgrade the server without changing IP address, a bit of a price dispute, and the fact that the server was owned overseas. My new 3essentials server has it over on all those issues, including a base price that matches the discounted price I had before, and the ability to upgrade it without changing IP._

This does mean a one-time change in IP address, though.
You'll see that your Enter Webz apps are now replaced with a single banner explaining what to do, and clicking it takes you to a page that explains it as well.
I've paid my old provider through the end of February or so, and that server will go away by March, 2015.
All your settings have been transferred to the new server.

This release also includes a few changes to Enter Webz:

Added "Social, Email, & Shopping / Twitter.com" and "Games & More / @TiVo page"
Added "XKCD Explained" comic page
Remote control hint icons vastly improved
Menu option to turn off remote control hints on site pages
\032 spaces fixed in titles of download version
added a small clock in the status bar (using​ ​your TiVo's​ ​Time Zone)
Adjustment to table rendering​ ​(helps with twitter.com)
Updated TiVo Model/Remote Info (support for ComSec E80 model/remote)
handles more errors without crashing (and logging treats idle timeout as a clean exit)
remote ​loaded ​background images instead of inline - UI is more responsive, but the background starts out blank​ ​and TiVo's image caching ​is buggy and can break this until a reboot.

The banner is kind of unexpected, eh? Only works on HD UIs but it's using the same trick I've mentioned before: using a specially sized PNG for the icon which in this case is just a solid banner covering the title text. Series 3 and earlier and SD UIs see the text instead (and a section of the banner). If I ever get any advertisers to help me pay for this, this will be the most expensive option for them.


----------



## nooneuknow

So, if I'm following this correctly, having finally got the Plex client for all my computers/laptops/tablets/phones, and having finally downloaded the server app, this gives my TiVo what Plex just gave to everything else, pretty much, and I just don't require my own server for it?

I wonder what will be left, other than not requiring a server at home, if/when Plex shows up in the TiVo Opera store...

I'm not downplaying all your hard work, time, and effort. The thing that kept me away from Plex was not wanting to have to run a server of my own, in order to use it for anything. I still have my doubts about TiVo letting a Plex app in their sandbox, and assume they'll find a way to make it crippled/slow, making me want to switch active TV input, to just use a product with a better/faster implementation (like many do with Vudu & Amazon Prime, after all this time waiting for such OTT apps on TiVo).

Good luck, thanks, and best wishes. I'll add this to my "To Try Out" list. :up:


----------



## Fofer

nooneuknow said:


> So, if I'm following this correctly, having finally got the Plex client for all my computers/laptops/tablets/phones, and having finally downloaded the server app, this gives my TiVo what Plex just gave to everything else, pretty much, and I just don't require my own server for it?
> 
> I wonder what will be left, other than not requiring a server at home, if/when Plex shows up in the TiVo Opera store...
> 
> I'm not downplaying all your hard work, time, and effort. The thing that kept me away from Plex was not wanting to have to run a server of my own, in order to use it for anything. I still have my doubts about TiVo letting a Plex app in their sandbox, and assume they'll find a way to make it crippled/slow, making me want to switch active TV input, to just use a product with a better/faster implementation (like many do with Vudu & Amazon Prime, after all this time waiting for such OTT apps on TiVo).
> 
> Good luck, thanks, and best wishes. I'll add this to my "To Try Out" list. :up:


This is more of a general purpose web browser for TiVo. Accessing Plex/Web is just one way it may be used. There are better options for Plex now, and on the horizon. Enter Webz is for other stuff, as detailed in this thread.


----------



## myklbear

Hello David.
Thanks for your great work. I am new to Tivo with a Roamio + but not new to streaming or servers. 
I downloaded the December files and have successfully connected to your central server and browsed PBS.
But with that release, the launcher file is very spartan and I have not found much in the way of clues as to what to add.
I have perused the last year of the forum.
1. I am running W7 do not have a Java key in HKLM.

2. From one of your messages, I have sussed and added the following:
JAVA_HOME: "See:*Program Files*Java*jre1.8.0_31"
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
MDNS: http:**192.168.231.231:7288*webz*

3. but still get the dos message as I got prior to adding:
ERROR: The system was unable to find the specified registry key or value.
ERROR: The system was unable to find the specified registry key or value.
Please set the JAVA_HOME environment variable
to your Java installation directory.
e.g. See:*Program Files (x86)*Java*jre7
Press any key to continue . . .

Any help you can offer I would greatly appreciate. Thanks


----------



## myklbear

David,
By the way, after I get this worked out, I will be glad to test for you. Thanks.
michael


----------



## davidblackledge

myklbear said:


> Hello David.
> Thanks for your great work. I am new to Tivo with a Roamio + but not new to streaming or servers.
> I downloaded the December files and have successfully connected to your central server and browsed PBS.
> But with that release, the launcher file is very spartan and I have not found much in the way of clues as to what to add.
> I have perused the last year of the forum.
> 1. I am running W7 do not have a Java key in HKLM.
> 
> 2. From one of your messages, I have sussed and added the following:
> JAVA_HOME: "See:*Program Files*Java*jre1.8.0_31"
> HME SDK 1.4 (TiVo, Inc.)
> LOG: added factory
> MDNS: http:**192.168.231.231:7288*webz*
> 
> 3. but still get the dos message as I got prior to adding:
> ERROR: The system was unable to find the specified registry key or value.
> ERROR: The system was unable to find the specified registry key or value.
> Please set the JAVA_HOME environment variable
> to your Java installation directory.
> e.g. See:*Program Files (x86)*Java*jre7
> Press any key to continue . . .
> 
> Any help you can offer I would greatly appreciate. Thanks


Thanks for the message! I was starting to get lonely posting all these messages to myself.

I'm a little confused. #2 is what you should see if it successfully launched, #3 if you don't have JAVA_HOME set in your env.
Did you see #2, or are you just saying you're hoping for that?

If you saw #2 once but then later saw #3 it makes me think you set JAVA_HOME in a non-permanent way.

If you right-click Computer, select Properties..., then select Advanced System Settings, on the Advanced tab you can click the "Environment Variables..." button.
set JAVA_HOME in there, and you should be good to go.
(if it doesn't work still, try a reboot, and double check the JAVA_HOME is still set in "Environment Variables..." after your reboot)

If it still doesn't work, try to cut & paste the output here and we'll see if anything helps me out there.

If #2 is what you're getting and you just want more things to show up on your TiVo, edit launcher.txt and add entries like:


Code:


#group
com.blackledge.david.html.hme.WebBrowserApp file:Apps/video "Apps/video/"
#website
com.blackledge.david.html.hme.WebBrowserApp http://www.google.com "Google"


----------



## myklbear

Hello David,
I was feeling ill the other day so should not have been trying this let alone trying to explain what was happening. Good news is I have connected after some Googling and experimenting.

Solution follows for Windoz 7.

Go to Control Panel and click "System".
Bring up master System page and click on "Advanced System Settings"
On Advanced tab select "Environmental Variables" at bottom.

In User Variables select New and add WITHOUT quotes:
'JAVA_HOME' as Variable and the complete path to your JAVA directory
{{ Example = C:*Program Files (x86)\Java*jre1.8.0_31 }}

Click OK and then re-enter Environmental Variables
In System Variables do this again the same way.

Click OK and then re-enter Environmental Variables
In System variables click on the Path line and at the end of the line add:
{a semi-colon} followed again by your complete path as above.
Click OK and exit out.

Open DOS window:
type without quotes "echo %JAVA_HOME%" and check it is correct.

CD [Change directory] to your EnterWebz directory.
{{ Note that I made a copy of the bat file without the space between Enter and Webz. }}
Type EnterWebz.bat and get the following [with YOUR system ip and directories]

C:\Program Files (x86)\Java\EnterWebz>EnterWebz.bat
JAVA_HOME: "C:\Program Files (x86)\Java\jre1.8.0_31"
HME SDK 1.4 (TiVo, Inc.)
LOG: added factory
LOG: added factory
LOG: added factory
LOG: added factory
LOG: added factory
LOG: added factory
LOG: added factory
LOG: added factory
LOG: added factory
MDNS: http://192.168.231.232:7288/webz/
MDNS: http://192.168.231.232:7288/webz1/
MDNS: http://192.168.231.232:7288/webz2/
MDNS: http://192.168.231.232:7288/webz3/
MDNS: http://192.168.231.232:7288/webz4/
MDNS: http://192.168.231.232:7288/remote/
MDNS: http://192.168.231.232:7288/minesweeper/
MDNS: http://192.168.231.232:7288/aqi/
MDNS: http://192.168.231.232:7288/blitz/

I hope this helps.

Is it necessary to keep the DOS window open after running the BAT?

Though this seems to be correctly setup, I cannot open a new app on the TIVO at my above address. I get a V310 message. I have given some permissions in Kaspersky and my internal network is open [I stream from same PC to Mede8er and needed nothing for it to see files].

I have been on YOUR PBS and YouTube and they seem to work OK [though Exiting or backing up I haven't mastered yet.] PBS seemed soft, but that is probably streaming.

I found that the archives.org videos kept coming back as not supported format and moved on.

Though I have a 65" screen, it is excellent Hitachi RPTV and the on screen print is very small to unreadable small. [I know, I know. Time to upgrade.]
But it took me a while to realize the row of icons at top of screen give you the buttons on remote for controls. Could they be larger?

Again, thanks a lot for this wonderful effort!


----------



## davidblackledge

myklbear said:


> Hello David,
> I was feeling ill the other day so should not have been trying this let alone trying to explain what was happening. Good news is I have connected after some Googling and experimenting.
> 
> Solution follows for Windoz 7.
> ...


Glad that worked! thanks for posting your success.


> Is it necessary to keep the DOS window open after running the BAT?


yes, I didn't put any effort into a fancy detaching launcher. I think there are some things on the Internet somewhere that can wrap it up for you, if you like.


> Though this seems to be correctly setup, I cannot open a new app on the TIVO at my above address. I get a V310 message. I have given some permissions in Kaspersky and my internal network is open [I stream from same PC to Mede8er and needed nothing for it to see files].


My only useful thought on this is the previous attempts may have confused the TiVo. It sometimes takes a while for changes to shake loose with how TiVo handles the MDNS technology. If you shut it down, wait (10 minutes to a half hour) for the listings to clear out of the TiVo, then start it up, hopefully it will only be using the correct information and hopefully it will all work as expected. A TiVo reboot is an option, too. It will definitely be cleared out then.
Of course, by the time you read this, enough time SHOULD have passed for any issues to shake loose by now, anyhow.

If you still have issues, try to give me a step by step with actions and responses and maybe I'll realize something else.


> I have been on YOUR PBS and YouTube and they seem to work OK [though Exiting or backing up I haven't mastered yet.] PBS seemed soft, but that is probably streaming.
> 
> I found that the archives.org videos kept coming back as not supported format and moved on.


Yeah... that seems to be getting worse lately at archive.org. Also they use a weird URL for the media (and the image) in that RSS feed that doesn't always work as well as the links on the regular pages.
If you select the title of a video you'll go to the full web page for that video and it will list all of its available file formats... usually you'll have better luck there, but it's a big, busy page.


> Though I have a 65" screen, it is excellent Hitachi RPTV and the on screen print is very small to unreadable small. [I know, I know. Time to upgrade.]
> But it took me a while to realize the row of icons at top of screen give you the buttons on remote for controls. Could they be larger?


Yes, I agree... I've been meaning to increase the size of the font for hints for a while and just haven't gotten around to it.

As for the web sites themselves, you can change font size using the number keys or the INFO menu, but that doesn't change the size of the hints or the title or status bar.


> Again, thanks a lot for this wonderful effort!


Thank YOU for posting! I had almost lost hope... not a single response on any of my "Coffee House" posts of the last two months, and, as of today, a total of two people have tried my new "Radio Auricle" app 

I guess I shouldn't complain, though... traffic has been steadily increasing since the 1.0 release. It's just hard to work in a vacuum.


----------



## davidblackledge

davidblackledge said:


> 2) Scaling, like I mentioned previously, is handled with a setting the View's scale and position, but the position has to NOT be up against the upper and left edges of the screen or the scale is ignored by the video stream (and destabilizes I think)


FYI, I was exploring video scaling again (trying to come up with in-app aspect ratio correction) and I have a correction to the above.

It turns out Video Scaling is specifically ignored if the X scale is 1.0. If you want to "squish" your video vertically and leave horizontal alone, you have to use a horizontal scale like 0.99999 to make sure vertical scaling isn't ignored. Left/Top position is not actually relevant to how scaling is interpreted.

This also affects positioning (position is ignored and the view just clips the video if video is not scaled down below 1.0)

This actually makes more sense than my previous assertion.


----------

