Flash Players - Fast Forward / Rewind and "feature sniffing"

1,852 views
Skip to first unread message

Benjamin Wanicur

unread,
Jul 22, 2012, 5:13:54 PM7/22/12
to sandi...@googlegroups.com
Hello Javascript People!

I often find myself in the situation of wishing that flash players on websites had fast-forward and rewind abilities, without using the scrubber.  Musicians often must transcribe music to learn a song.  When one has to rewind one section of music over and over again, using the mouse and the scrubber can be an unpleasant and time-consuming experience.  

I have no experience writing flash code, but I believe the following is true:  a web developer cannot control a flash player's functionality without out access to the source code, which is usually hosted externally.  What I'm wondering is if there is a way to "sniff" a flash player's API.  Is there a way to find out what it can do ?  Ultimately I'd like to write some kind of web scripts that could assign fast-forward and rewind to a hot-key.  

On a side note, I am wondering about the same API sniffing for mac applications.  I am looking at the Rdio player in particular.  I'd love to write an apple script to assign fast-forward and rewind to hot keys, but I cannot tell if those features are even supported by the Mac Rdio players "API".

Sorry if this is a bit off-topic for this group, but I thought there might be some people with flash knowledge that subscribe to this group.

Thanks

Ben W

Jarrod Overson

unread,
Jul 23, 2012, 8:33:51 PM7/23/12
to sandi...@googlegroups.com
I don't have a lot of experience with flash, but for the little I did to interfacing with the webcam it doesn't seem like this would be very straightforward to do in a dynamic way. The API from flash to javascript seemed dependent on the developer's whims, so I don't think you can sniff for anything reliable.

You got me curious about the RDIO web app though (not the client app). If you're interested in setting up rewind/fastforward hooks, it looks like you should be able to do something like this 

R.Services.Player.seek(R.Services.Player.model.get('position') - 5);

Have to be impressed with a codebase that is easy to follow even when obfuscated.
--
Jarrod Overson

Ben Wanicur

unread,
Aug 8, 2012, 9:23:48 PM8/8/12
to sandi...@googlegroups.com
Thanks for your insight Jarrod.  After a few busy work weeks, I was inspired to write a chrome extension, since having Rewind and Fast-Forward would really be a nice thing to have for transcribing.  I wrote the shell of the extension before learning (RTFM!) that Chrome Extensions run in an "isolated world", and therefore do not have access to global objects, like the R.Services.Player, and all the goodness it provides.  Chrome Extensions can interact with the DOM.

So my next step is to interact with the flash player directly, by wading through the obfuscated JS code and trying to figure out how it works.  As I have already demonstrated, I am a bit slow with the JS code, and would love help on this project.  If anyone on this list is going to the next JS hackfest and would like to work on this project, let me know!

Here is the repo for the incomplete Chrome Extension: https://github.com/bwanicur/Rdio-Hot-Keys-Chrome-Extension

In the meantime, if anyone really wants Fast-Forward, Pause, and Rewind Hot Keys (transcribing musicians out there?), you can paste the following gist into the JS console of your browser of choice, and viola... a really ugly work-around:  https://gist.github.com/3300075

Cheers

Ben W

Sander van Zoest

unread,
Aug 9, 2012, 12:23:12 AM8/9/12
to sandi...@googlegroups.com
On Wed, Aug 8, 2012 at 6:23 PM, Ben Wanicur <bwan...@gmail.com> wrote:
Thanks for your insight Jarrod.  After a few busy work weeks, I was inspired to write a chrome extension, since having Rewind and Fast-Forward would really be a nice thing to have for transcribing.  I wrote the shell of the extension before learning (RTFM!) that Chrome Extensions run in an "isolated world", and therefore do not have access to global objects, like the R.Services.Player, and all the goodness it provides.  Chrome Extensions can interact with the DOM.

So my next step is to interact with the flash player directly, by wading through the obfuscated JS code and trying to figure out how it works.  As I have already demonstrated, I am a bit slow with the JS code, and would love help on this project.  If anyone on this list is going to the next JS hackfest and would like to work on this project, let me know!

Here is the repo for the incomplete Chrome Extension: https://github.com/bwanicur/Rdio-Hot-Keys-Chrome-Extension

In the meantime, if anyone really wants Fast-Forward, Pause, and Rewind Hot Keys (transcribing musicians out there?), you can paste the following gist into the JS console of your browser of choice, and viola... a really ugly work-around:  https://gist.github.com/3300075

Hi Ben,

Neat stuff.
If you are mostly looking at audio from youtube, you can probably use many of the youtube to mp3 converters out there and then use the chrome plugin or site such as
http://transcribe.wreally.com/ or  http://www.universalsubtitles.org/en/ (the source is at https://github.com/pculture/unisubs).

I know it isn't as fun as writing it yourself and it seems like you are not looking to get a text translation, but may get the job done?

-- Sander

Ben Wanicur

unread,
Aug 9, 2012, 12:36:03 PM8/9/12
to sandi...@googlegroups.com
Those are interesting projects Zander, but as you guessed, by transcribing, I am more interested in musical transcribing.  If I have a mp3, there are many software solution programs that are tailored around transcribing.  Probably the most popular one is called (go figure), Transcribe (http://www.seventhstring.com/).   

I think this extension would help fill a void for musicians using streaming music services.  I personally like Rdio because I find Spotify's tie in with Facebook annoying.  I know that when someone wants me to learn a song, 9 times out of 10 they say, check it out on Youtube.  That is fine for listening to a song, but if I need to learn a tricky bass line or melody, I usually do a lot of rewinding, pause, play, repeat....  And many times, I do not want to download the mp3 (add bloat to my music collection) - especially if it is a song I do not personally enjoy.

I'm sharing this opinionated information because I think this extension (and probably it would make sense to write a Greasemonkey script for Firefox users) would be well received by the musician community.  If anyone out there would like to help me hack on it, please get in touch!

Cheers

Ben 
Reply all
Reply to author
Forward
0 new messages