The Clipstream™ applet (and any other embedded media)
is normally displayed on a page through the use of the following .js
(JavaScript) include method. This .js is automatically created by the Encoder.
However, if you have pre-existing clips that need to be converted from pure
applet code to javascript include, follow this guide.
How does Clipstream™ play without this method?
The applet will load normally but a box will appear around
it. The user can press space-bar or right click to enable the applet. Then
the applet will be allowed to function normally.
Note: The Encoder creates a .js by default.
You do not need to refer to this page unless you have turned off that option
in the Encoder.
-or-
The user can click on the button panel *twice* and it will
play.
AutoPlay works as normal
If the applet is set to AutoPlay, then the applet will play
normally as this does not require user activation.
The Method
Follow the steps below to 1) Convert regular applet code
to JavaScript lines. 2) Save it as a .js file. 3) Include that file as a .js
link.
Prerequisites
- text or web page editor
- existing Clipstream™ Audio applet and generated files
- ability to upload files to a web server
Step 1: Copy and paste applet code into new document
- View the source of the generated Clipstream™ Audio page and find
the Clipstream™ Audio applet.
- Highlight all of the applet code including the <applet
tags. Copy it.
- Create a new blank document in a text editor or web page editor.
Note: Make sure it has no code whatsoever. No body tags. No html tags.
A completely blank page.
- Paste your selected Clipstream™ Audio applet code in that new
page.
Step 2: Make each line a JavaScript line.
- Launch the Find and Replace function in your text editor.
- Replace every double quotation marks with single quotation marks.
"
with
'
- Then, replace every
<
with
document.writeln( " <
- Then replace every
>
with
> ")
After this is done the lines in the applet code will look like this:
document.writeln( " <PARAM NAME='AutoPlay'
VALUE='True'> ");
Note: Every line must be enclosed by the document.writeln(
"< and >") tags.
- Save the file with the extension .js.
ex. myAudiofile.js
Step 3: Create a link in the target page that references
the .js.
- Upload your .js file to your webserver and take note of its URL location.
- Open up the code for the target page where you want the Audio to appear.
- Write this line of code:
<SCRIPT LANGUAGE="JavaScript" SRC="[URL
of your .js file]"></script>
- Save and upload.
When you view the page in your browser it should display as if you had
the applet normally pasted in the page.
NOTE: Since this requires javascript enabled, any browsers that do not
enable it will not see this.