| Author |
Message |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: Thu 02 Oct 2008, 09:55 Post subject:
playflash (mediaplayer instead slow player in your browser) Subject description: works with youtube |
|
Flash movies embedded in webpages often are very slow, as these players do not support hardware accelleration.
So you might prefer, to see them in your mediaplayer.
This is a very small script, that is placed in /root/Startup/ and (/root/autostart for Muppy).
You must restart X or click on it to activate it.
It scans /tmp/ every 5 seconds for a Flash* file.
If it is detected, your mediaplayer is run with this file.
Default player is mplayer, if that is not available, gxine is used.
You can edit the script to set another defaultplayer.
To test it:
visit:
http://www.golem.de/0809/62664.html
Click on the embedded Video to start it.
Click on the stop-icon, to stop it.
Now it will be buffered, but it is not shown in the slow player.
Wait 5 seconds, and your mediaplayer should start and show it.
Mark
| Description |
|

Download |
| Filename |
playflash.pet |
| Filesize |
569 Bytes |
| Downloaded |
1455 Time(s) |
_________________ my recommended links
|
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 4378
|
Posted: Thu 02 Oct 2008, 12:51 Post subject:
|
|
Hmm good old trick is that one....I wonder perhaps you could add function to give a 'save as' option too...seems like a popular request...and as a script would remain very lightweight.
mike
|
|
Back to top
|
|
 |
magerlab
Joined: 08 Jul 2007 Posts: 730
|
Posted: Fri 03 Oct 2008, 14:25 Post subject:
|
|
thak you Mark!
i also see that i can see that video is in /temp
will 5 sec interval affect cpu of old machines?
_________________ skype: desafimager
www.youtube.com/sagartem -videos of my band
|
|
Back to top
|
|
 |
MU

Joined: 24 Aug 2005 Posts: 13642 Location: Karlsruhe, Germany
|
Posted: Sat 04 Oct 2008, 05:49 Post subject:
|
|
no, 5 seconds should be ok.
To check it, type in a console:
top
That displays the running programs sorted by cpu-usage.
---------------------
A save-option could be done, it could be a good exercise for people who want to learn writing tools with bash and Xdialog.
I'm too busy at moment to write it on my own.
Mark
_________________ my recommended links
|
|
Back to top
|
|
 |
Flash
Official Dog Handler

Joined: 04 May 2005 Posts: 9848 Location: Arizona USA
|
Posted: Sun 26 Oct 2008, 22:17 Post subject:
|
|
I installed the .pet, then discovered that if I pause a youtube video while it is playing, it will continue to load into /tmp and the Flash file in /tmp will play in gxine when I click it. It seems that I have to either delete it from /tmp or move it somewhere else before the next one will save in /tmp.
|
|
Back to top
|
|
 |
John Doe
Joined: 01 Aug 2005 Posts: 1689 Location: Michigan, US
|
Posted: Mon 27 Oct 2008, 00:44 Post subject:
|
|
regarding 5 seconds: perhaps 5 seconds isn't enough time to buffer on slower server streams and/or client connections...
this is a cool idea MU but a couple thoughts regarding potential problems that will arise.
1-not every flash file that lands in /tmp is desired media. there are menus, ads and other "site parts" written in flash. these will launch also.
2-even if there is only one flash object on the page that is desired media, it will most likely also auto play in the browser flash plug-in. with both playing, it would overload an older machine (900mhz, like I'm on) for sure.
my thoughts on a "perfect solution" for the problem you are trying to solve.
a custom moz plugin that displays a standard gui with three options:
1-save as
2-play
3-display
internally the plugin would function as follows:
1 - ask for location and output the binary stream there
2 - dump binary stream as unique file name to /tmp and launch 'defaultmediaplayer' with said unique file name.
3 - unload itself and load flash player plugin for display (good for site menus or sites in 100% flash). I don't even know if this is possible, just saying how it could be easily accomplished.
in closing...
UP YOURS ADOBE!!!! I'm sick of your crappy plugin!!
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Mon 27 Oct 2008, 01:20 Post subject:
|
|
...or maybe couple this with the Flashblock plugin for some real speed?
|
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 4378
|
Posted: Mon 27 Oct 2008, 10:54 Post subject:
|
|
Flash has to be loaded as it is this that downloads the flv not the browser directly....usually as a randomly named file..so blocking flashplayer won't work.
This will continue until it is complete or the page is navigated away from.
Perhaps a better way to detect would be to locate the file in temp that is steadily growing... (unless mu is already doing that)...
I will have a play with this
mike
edit..alternative approach
http://bashscripts.org/viewtopic.php?t=210
|
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 4378
|
Posted: Mon 27 Oct 2008, 13:39 Post subject:
|
|
Ok that link is a little out of date....
here and updated version...given the you tube url it downloads the flv and plays it with a media player...flash player not needed....something to chew on
mike
| Code: | #!/bin/bash
wget -c -S -O tmp.flv `curl -s $1 | grep swfArgs | awk '{print $7 "get_video?video_id=" $11 "&t=" $19}' | tr -d '",'` &
vlc tmp.flv
|
|
|
Back to top
|
|
 |
technosaurus

Joined: 18 May 2008 Posts: 3843
|
Posted: Mon 27 Oct 2008, 16:22 Post subject:
|
|
@mikeb vlc --> gxine (in the posted code) for default puppy?
@all - This might be a perfect addition to FirePup
|
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 4378
|
Posted: Mon 27 Oct 2008, 17:53 Post subject:
|
|
Just a serving suggestion.....a dialog could be added.....vlc can be gmplayer/gxine etc.
By the way it seems that if &fmt=18 is added to the url then the original video is downloaded.
mike
edit
hmm...seems like www.youtube.com rejects curl but uk.youtube.com works
I used dfa=`echo $dfa | sed 's/www/uk/'` where dfa = address to work round this.
|
|
Back to top
|
|
 |
mikeb

Joined: 23 Nov 2006 Posts: 4378
|
Posted: Wed 29 Oct 2008, 12:40 Post subject:
|
|
Ok..still with the topic i hope...
I made a simple script to test loading/playing vids from youtube .
Also does straight downloads too....plus the 'you tube(s)' button tries to download the original movie...usually mp4 format ....there is the option to play the download with default player.
Now combining this with a browser rather than copying and pasting links would be neat step.
have fun
mike
not happy with sleep being used to buffer the start but works for test.
Edit :- Ok seems you tube have added an ad into the url string so here's an updated version. By the way I am using the uk url rather than us as www returns nothing wuth curl (?!!)
| Description |
|

Download |
| Filename |
YouTubeTest_v2.tar.gz |
| Filesize |
997 Bytes |
| Downloaded |
512 Time(s) |
|
|
Back to top
|
|
 |
E2001

Joined: 12 Dec 2008 Posts: 45
|
Posted: Sat 13 Dec 2008, 14:26 Post subject:
|
|
I'm not trying to to rain on anyone's parade, but...
If you use firefox as your browser, there are many plugins that allow you to download embedded media. I use one called: Video DownloadHelper. It can extract pretty much anything. Not automatic, tho.
Sorry if I missed the point.
|
|
Back to top
|
|
 |
stifiling
Joined: 29 Dec 2007 Posts: 387
|
Posted: Wed 16 Sep 2009, 16:14 Post subject:
|
|
does this still work? was able to get it to go before, now it's not on 4.1.3
|
|
Back to top
|
|
 |
swiatmar

Joined: 09 Aug 2008 Posts: 238 Location: Danube, AT
|
Posted: Sat 24 Oct 2009, 20:43 Post subject:
|
|
Hi!!
I don't really know why, but it doesn't work on my computer. I have installed this pet and somehow nothing is happening. I am running puppy 4.2
regards
mar
|
|
Back to top
|
|
 |
|