New YouTube App for Stock OS - Version 1.0 – 10 July 2011

General discussion relating to the O2 Joggler, from the default O2 setup, to alternative operating systems and applications.
Post Reply
spoyser
Posts: 134
Joined: Mon Mar 07, 2011 6:45 pm

New YouTube App for Stock OS - Version 1.0 – 10 July 2011

Post by spoyser »

Latest Version YouTube App – Version 1.1 – Released 19 August 2011
See here:
http://www.jogglerwiki.com/forum/viewto ... ?f=2&t=217 )
-------------------------------------------------------------------------------



New YouTube App – Version 1.0 – Released 10 July 2011
-------------------------------------------------------------------------------

Having spent a little while looking into “fixing” the Openpeak YouTube app I finally decided it was quicker and easier to implement an alternative.

So I give to all those sticking by the stock Joggler OS my alternative YouTube app.

(The app is entirely free although donations to my paypal account are of course acceptable :-)
http://www.paypal.com/cgi-bin/webscr?cm ... MQ4YPZKY6Q )

The app is loosely based upon the original one but with a few improvements thrown in:

1) Twice as many built in feeds:
Featured
Most Viewed
Top Rated
Most Popular
Favorites
Trending (aka On The Web)

2) The ability to view more than just the 1st 25 results of a feed
3) A cleaner (IMHO), minimilistic interface with touch screen style scrolling lists
4) Nicer more responsive on screen keyboard (IMHO)
5) And last but by no way least it plays ALL (afaik) embeddable YouTube videos!

(for more info on why the Openpeak app stopped working see here http://groups.google.com/group/youtube- ... 049b015e34 )

At the moment the app uses the embedded YouTube player. TBH the controls on this are a bit fiddly (as they are a bit small on the joggler screen) and I would like to implement a version using the chromeless player with custom controls but that will take a bit more effort and I didn’t want to delay releasing this first version.

For those interested the URLs used to supply the data feeds are:
Featured - http://gdata.youtube.com/feeds/api/stan ... results=10
Most Viewed - http://gdata.youtube.com/feeds/api/stan ... time=today
Top Rated - http://gdata.youtube.com/feeds/api/stan ... results=10
Most Popular - http://gdata.youtube.com/feeds/api/stan ... results=10
Favorites - http://gdata.youtube.com/feeds/api/stan ... results=10
Trending (aka On The Web) - http://gdata.youtube.com/feeds/api/stan ... results=10

More info on this can be found here:
http://code.google.com/apis/youtube/2.0 ... dard_feeds

As with my iPlayer app the SWF is really just a way of obtaining the YouTube video ID and then passing it onto a script that launches a second SWF (supplied by YouTube.com so should always work!) that plays the video, this is done in the youtube.cgi file. If you look in this file you will see toward the end the line that does the launching:

./tango "http://www.youtube.com/swfbin/watch_as3.swf?iv_load_policy=3autoplay=1&controls=1&autohide=1&rel=0&video_id="$app

If you want to play around with the parameters feel free, they are defined here:
http://code.google.com/apis/youtube/pla ... eters.html

You can even use an alternative video player if you so wish (and you know what you are doing) by editing this line appropriately.

To Use:
1) To view a built-in feed, click the appropriate tab, feeds are requested each time a tab is clicked rather than the data being stored, this is due to feeds being updated fairly regularly by YouTube so when you click a tab you are getting the most current version of that feed.

2) To search click the search tab; click the input box; type any words(s) to search on; hit done; hit search button.

3) The 1st 10 Videos in a feed or results of a search are presented in a vertical scrolling list. At the bottom of the list you will usually see the word “more…”, each time this is clicked the next 10 results are added to the list.

4) To view a video tap the thumbnail.

5) When viewing a video tap the screen to toggle between pause and play and also to bring up the volume/mute, transport, closed caption and resolution controls. Hit the X in the top right to stop the video and return to the app.

To install YouTube app
telnet into joggler, then

cd media
mkdir youtube
cd youtube
wget ftp://aero.exotica.org.uk/pub/mirrors/exotica/joggler/files/youtube.tgz
tar xvf youtube.tgz
rm youtube.tgz
chmod +x youtube.cgi (VERY IMPORTANT, this makes the file executable, without this it will NOT work)
cd
cd media/appshop
cp applications.xml applications.original (creates a backup of file, just in case...)
vi applications.xml

i (enters insert mode)
Add the following immediately before the final </applications>

<app id="youtube1" title="youtube1" loc="/media/youtube/" icon="icon.swf" app="main.swf"/>

Then hit ESC followed by :x return (save and exit)

Restart joggler

1st NOTE the final slash at the end of the app tag, if you miss this you will get no icons on the main joggler screen!!

2nd NOTE the id and title are “youtube1” not “youtube” so as not to interfere with the exisitng YouTube app

Comments, suggestions and any constructive critisicms are of course welcome!

Hope that all makes sense!
Enjoy!
Last edited by spoyser on Fri Aug 19, 2011 5:35 pm, edited 5 times in total.
yugo
Posts: 32
Joined: Fri Mar 04, 2011 8:43 am
Location: N Ireland

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by yugo »

Great job once again spoyser, much better than the original.
Only had a quick play but everything seems to work fine.
eduponesarris
Posts: 45
Joined: Sat Mar 05, 2011 6:33 pm

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by eduponesarris »

Spoyser... I'm definitely doing something wrong with vi. Twice now I have tried to install an app, and twice I have lost all the icons. I used Putty to go back in and recreate applications.xml from the backup made as part of your script.... I think I need to read up on moving the cursor and inserting lines as I suspect that is where I am going wrong. I definitely copied the text including the backslash, and the applications xml has the Iplayer and Squeezeplayer entries so has updated before. Take 200 lines... must learn Linux !!

J
yugo
Posts: 32
Joined: Fri Mar 04, 2011 8:43 am
Location: N Ireland

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by yugo »

You could always use winscp to do it.
nigelh
Posts: 27
Joined: Mon Jun 13, 2011 10:05 am

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by nigelh »

Excellent work spoyser. Its works very well, and I had no problems installing. Instructions were spot on.
spoyser
Posts: 134
Joined: Mon Mar 07, 2011 6:45 pm

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by spoyser »

@eduponesarris

After you have edited the applications.xml file can you post the output of this command

cat /media/appshop/applications.xml

So I can see what is wrong with it.
gegs
Posts: 1146
Joined: Fri Mar 04, 2011 3:22 pm
Location: Edinburgh

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by gegs »

yugo wrote:You could always use winscp to do it.
I agree wholeheartedly. I've used linux (dual booting with Windows) for 13 or 14 years and have never used vi. It may be powerful but it is old-fashioned, clunky and very user-unfriendly for non-geeks.

If you have a Windows machine use WinSCP (it might even work in linux using Wine but I've not tried that). Follow all the instructions to the letter - up to the bit about editing the applications.xml file with vi. Now open WinSCP, click on the "New" button, enter the IP address of your Joggler and your user name (default being 'letmeinssh') choose 'SCP' from the 'File protocol' drop-down and leave all the other fields blank or at their default setting. Click 'Save'.

Your Joggler should now be listed on the 'Saved sessions' list and you can connect by double clicking it. You will be asked for the password (P'n'P default being 'joggler1234'). Now you should see a two-paned interface, local filesystem on the left and Joggler filesystem on the right. You can edit '/media/appshop/applications.xml' by double clicking on it; an editor will open and you can paste in the appropriate line and save it (you'll be prompted for password again) - and that's it. Easy!

It is also the best way to backup important Joggler files before tinkering. You can simply drag and drop files to copy them to your computer.
eduponesarris
Posts: 45
Joined: Sat Mar 05, 2011 6:33 pm

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by eduponesarris »

Downloaded Winscp, nifty little program indeed !! (Snags logging in at first but remembered I hadn't pimped it so did that and got it working)

applications.xml edited as outlined above and it now reads:
<?xml version="1.0" encoding="utf-8"?>
<applications>
<app id="iPlayer" title="iPlayer" loc="/media/iPlayer/" icon="icon.swf" app="main.swf"/>
<app id="launcher" static="1" ext="1" standalone="1" loc="/media/launcher/apps/SqueezePlay/" icon="icon.swf" app="/media/launcher/apps/SqueezePlay/trigger.cgi"/>
<app id="youtube1" title="youtube1" loc="/media/youtube/" icon="icon.swf" app="main.swf"/>
</applications>

And icon has now appeared.... I am now a Winscp devotee !!!

Thanks gegs... I am fairly ancient and indeed used to program regularly in GFA Basic... yes, that old... but can't get to grips with that vi...

TVM
darrenkellum
Posts: 35
Joined: Thu May 19, 2011 11:40 am

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by darrenkellum »

This is great, working fine on my Joggler.
Is it possible to make a larger volume control popup? Same also for the BBC app? I found last night that the volume wasnt adjusting on this youtube version but it may just be becuase I was using a USB soundcard. It just kept reverting to max after I hit play again.
spoyser
Posts: 134
Joined: Mon Mar 07, 2011 6:45 pm

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by spoyser »

@darrenkellum

I know the current volume control is rather fiddly due to being so small, I currently have mine going out via a USB sound card to my stereo so no a big deal for me.

I am however, currently adding the use of the AS3 chromeless player into the App (it currently uses the embedded AS3 player) which will allow me to add custom (bigger) controls to control volume and cueing (I never noticed before but this is missing from the Openpeak version) etc.
darrenkellum
Posts: 35
Joined: Thu May 19, 2011 11:40 am

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by darrenkellum »

Ok thanks that sounds great! Also wondering whether there is some way using the chromeless player you mention to select videos (maybe long press) and choose to save them to a list (Add to Tracklist for example). Then we could select a tab at the top or something that shows the selected tracks to play one after the other/random etc? Unless that is already possible via the app (sorry only had a few mins to play with it last night).
eduponesarris
Posts: 45
Joined: Sat Mar 05, 2011 6:33 pm

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by eduponesarris »

As this Winscp is so damn good, would it be possible to use it to edit out some of the apps on the stock OS that we would never use? That would be exceedingly useful..
Ta
J
yugo
Posts: 32
Joined: Fri Mar 04, 2011 8:43 am
Location: N Ireland

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by yugo »

All you have to do is edit openpeak/gui/o2-applications.xml putting <--! --> around any apps you don't want.
e.g <!--<app static="1" id="o2_calendar" loc="./apps/o2_calendar/" icon="icon.swf" app="main.swf"/>-->

Might be worth backing up the file before you make any changes
eduponesarris
Posts: 45
Joined: Sat Mar 05, 2011 6:33 pm

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by eduponesarris »

I get this error on running Winscp I need to sort out, but it is a cracking little prog.

Command 'groups'
failed with return code 127 and error message
-sh: groups: not found.

I have two joggles with stock OS, think I might just use one as a squeezebox player with a pair of active speakers in the living room, and take all extraneous apps off it.

Had a play after backing up the file, works no problem and down to one screen now. Will have another swatch at it, as I deleted the three games, but there is obviously a folder hierarchy, as the Games icon is still there but the 3 games have gone from inside the games icon.

Good fun this ! Every day is a Linux schoolday.

Thanks for advice on removing apps
yugo
Posts: 32
Joined: Fri Mar 04, 2011 8:43 am
Location: N Ireland

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by yugo »

Yeah I get that message too, doesn't seem to affect anything though.
Can't help you with game folder as I don't have that icon here. Perhaps there is another app called o2_games?
eduponesarris
Posts: 45
Joined: Sat Mar 05, 2011 6:33 pm

Re: New YouTube App for Stock OS - Version 1.0 – 10 July 201

Post by eduponesarris »

Soretd the groups error. You need to select just edit the login session that you put the login and password in and untick the option to look up user groups, removes the error..
Post Reply