/    Sign up×
Community /Pin to ProfileBookmark

javascript:playClip

I am trying to play low bitrate mp3’s in a browser window so that users need not use a media/music player.

The idea has come from this site [url=http://www.hmv.co.uk/hmvweb/displayProductDetails.do?ctx=-1;1;-1;-1&sku=398235]HMV Idea…[/url]
(nothing to do with the album featured ? , but if you click a track from the album, a sample loads in your browser window.
I have viewed the source, but tbh, do not really understand how to work it…

I have discovered that it comes from the function that this thread is titled (javascript:playClip).

Has anyone used this function before? Could you advise how to link a few songs etc to be used for my devleloping site…

Many thanks in advance… ?

to post a comment
JavaScript

5 Comments(s)

Copy linkTweet thisAlerts:
@ZnupiSep 28.2006 — <i>
</i>clipObj = document.createElement("embed");
clipObj.src="linkToAudioFile";
clipObj.setAttribute("hidden", "true");
document.body.appendChild(clipObj);

I don't know how to pause it. To stop it, just delete it:
<i>
</i>document.body.removeChild(clipObj);
Copy linkTweet thisAlerts:
@chris_baileyauthorSep 29.2006 — thanks for your reply & help...

So how and where does the (javascript:playClip) work and come in to it?
Copy linkTweet thisAlerts:
@Tweak4Sep 29.2006 — It's all in the source code...

I hope you're not thinking that "playClip" is a native JS command. You aren't going to just be able to put "playClip('mySong')" in your page and expect it to do anything.

The whole thing appears to be run by a java applet "audioclipstream.class"

PlayClip() is defined on line 379 of the source file, and appears to just call a couple of methods embedded in the .class.

The whole thing shouldn't be terribly hard to use, , but it's one of those things where you should probably get the author's permission before you lift it.

Alternatively, there are literally thousands of free flash-based mp3 players out there that you can use legitimately, and possibly even more easily than this one (not to mention the added bonus of having controls on-screen so that people don't have to listen to your music if they don't want. Nothing drives users away from a site faster than uncontrollable background sounds. You are far better off leaving the site silent and adding a "click here to listen to ________" link somewhere).


I added a flash -based player to my wife's mySpace page a few weeks ago with no trouble what so ever.

Just google for "flash mp3 player" or something to that extent.
Copy linkTweet thisAlerts:
@chris_baileyauthorOct 02.2006 — Thanks for you reply. With respect to your comments, I am writing a particular section, and with certain parts of the text that relate to music, clicking them will just load a snippet of the sound (just like that on the hmv site). I have got a flash mp3 player listing a chart of mine, but I am desperately after that code to use.

Anyone got any ideas?
Copy linkTweet thisAlerts:
@Tweak4Oct 02.2006 — Upon further investigation, apparently that audio player is a commercial product, so I can't help with how to lift their code (furthermore, it looks like it takes especially encoded files as input, so regular mp3s wouldn't work anyway).

For more info:

http://clipstreamaudio.com

If you're willing to pay their fee, I'm certain they would give you all the help you need in setting it up.
×

Success!

Help @chris_bailey spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...