-
Red5recorder and JavaScript functions
Hello,
I really need help how to run JavaScript functions to manipulate Red5 Recorder, showed on this page http://www.red5-recorder.com/red5-re...avascript.php?
None of the JS functions can be executed... Errors I'm getting are that ie. function startRecording (and all others) is undefined.
Also just to mention, that recording works well, I just need to run JS those functions from web page...
Can you help me please how to solve this? Here is my code:
Code:
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="history/history.css" />
<title>my page</title>
<script src="AC_OETags.js" language="javascript"></script>
<script src="history/history.js" language="javascript"></script>
<style>
body { margin: 0px; overflow:hidden }
</style>
<script language="JavaScript" type="text/javascript">
var requiredMajorVersion = 9;
var requiredMinorVersion = 0;
var requiredRevision = 28;
</script>
</head>
<body scroll="no">
<script language="JavaScript" type="text/javascript">
var hasProductInstall = DetectFlashVer(6, 0, 65);
var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if ( hasProductInstall && !hasRequestedVersion ) {
var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn";
var MMredirectURL = window.location;
document.title = document.title.slice(0, 47) + " - Flash Player Installation";
var MMdoctitle = document.title;
AC_FL_RunContent(
"src", "red5recorder",
"FlashVars", "server=rtmp://XYZ.XYZ.XYZ.XYZ/red5recorder&fileName=video1&maxLength=300&MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"",
"width", "640",
"height", "480",
"align", "middle",
"id", "red5recorder",
"quality", "high",
"bgcolor", "#ffffff",
"name", "red5recorder",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else if (hasRequestedVersion) {
// if we've detected an acceptable version
// embed the Flash Content SWF when all tests are passed
AC_FL_RunContent(
"FlashVars", "server=rtmp://XYZ.XYZ.XYZ.XYZ/red5recorder&fileName=video3&recordingText=Runnnn...&maxLength=300&showBar=false",
"src", "red5recorder",
"width", "640",
"height", "480",
"align", "middle",
"id", "red5recorder",
"quality", "high",
"bgcolor", "#ffffff",
"name", "red5recorder",
"allowScriptAccess","sameDomain",
"type", "application/x-shockwave-flash",
"pluginspage", "http://www.adobe.com/go/getflashplayer"
);
} else { // flash is too old or we can't detect the plugin
var alternateContent = 'Alternate HTML content should be placed here. '
+ 'This content requires the Adobe Flash Player. '
+ '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>';
document.write(alternateContent); // insert non-flash content
}
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
id="red5recorder" width="640" height="480"
codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab">
<param name="movie" value="red5recorder.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<embed src="red5recorder.swf" quality="high" bgcolor="#ffffff"
width="640" height="480" name="red5recorder" align="middle"
play="true"
loop="false"
quality="high"
allowScriptAccess="sameDomain"
type="application/x-shockwave-flash"
pluginspage="http://www.adobe.com/go/getflashplayer">
</embed>
</object>
</noscript>
<script>
// function to manipualte red5 recorder
function startRecording() {
document.getElementById("red5recorder").startRecording();
// start the recording of the video
}
function stopRecording() {
document.getElementById("red5recorder").stopRecording();
// stop the recording of the video
}
function playRecording() {
document.getElementById("red5recorder").playRecording();
// playback the recoprded video
}
function stopVideo() {
document.getElementById("red5recorder").stopVideo();
// stops playing the video
}
function playPause() {
document.getElementById("red5recorder").playPause();
// toggles pause/play of the video
}
function setVolume(value) {
document.getElementById("red5recorder").setVolume(value);
// sets the volume of the player
}
// callbacks functions: these are called from flash to javascript
function recordStarted() {
alert("record started");
// called when recording has started
}
function recordStopped() {
alert("record has stopped");
// is called when recording is stopped
}
</script>
<a href="#" onclick="startRecording()">Start</a>
</body>
</html>
Please help....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|