In my web application am able to display the video from rtsp link on mozilla browser but not able to display on chrome. Please suggest me to solve this problem.
this is my code
<OBJECT classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" codebase="http://downloads.videolan.org/pub/videolan/vlc/latest/win32/axvlc.cab" events="True">
<param name="Src" value="rtsp://cameraipaddress" />
<param name="ShowDisplay" value="True" />
<param name="AutoLoop" value="False" />
<param name="AutoPlay" value="True" />
<embed type="application/x-google-vlc-plugin" windowless="true" version="VideoLAN.VLCPlugin.2" autoplay="yes" loop="no" width="100%" height="100%" src="rtsp://admin:admin#x.x.x.x:111/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif" ></embed>
</OBJECT>
please help me guys this is my code and it works fine with me on the pc browsers but it need plugin to play it. I searched and tried a lot of methods to play this link live stream video but all of them are failed. This is the only code that plays the channel on the pc browsers and i need someone to help me or re-write the code so that can be played on pc and mobile devices browsers.
<html>
<head>
</head>
<body>
<object id='mediaPlayer1' width="640" height="360"
classid='clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6'
codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701'
standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject'>
<param name='fileName' value="http://168.187.49.14:8080" />
<param name='animationatStart' value='true' />
<param name='transparentatStart' value='true' />
<param name='autoStart' value="false" />
<param name='showControls' value="true" />
<param name ="ShowAudioControls"value="true" />
<param name="ShowStatusBar" value="true" />
<param name='loop' value="false" />
<embed type='application/x-mplayer2'
pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1'
bgcolor='darkblue' showcontrols="true" showtracker='-1'
showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="640" height="360"
src="http://168.187.49.14:8080" autostart="true" designtimesp='5311' loop="false"> </embed>
</object>
</body>
</html>
I am desperately trying to get this flash animation to play after 5 seconds, but nothing I do seems to make it work.
This is the code I am using:
function waitFiveSec() {
window.setTimeout(startPlaying,5000);
}
function startPlaying() {
window.document.getElementById("FlashID")
}
I am then calling the waitFiveSec() function on the HTML document:
<body onload="waitFiveSec()">
This is for a class project where I have to do timeline based events, so I have never really used JavaScript before.
Can anyone help me on this?
HTML Flash Code:
<div id="animation">
<p>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="365" height="295" id="FlashID" title="Tractor Animation">
<param name="movie" value="../Multimedia elements/Animations/Tractor Animation Opt 2.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<param name="autoplay" value="false" />
<param name="PLAY" value="false" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="../Multimedia elements/Animations/Tractor Animation Opt 2.swf" width="365" height="295">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="7.0.70.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<param name="autoplay" value="false" />
<param name="PLAY" value="false" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" /></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</p>
<p> </p>
</div>
</div>
Nothing seems wrong.
Only makee sure the file get loaded before you called from your html.
I have a webpage with several swf movies that is created in dreamweaver and outputs several object tags like such:
<object id="FlashID" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="160" height="600">
<param name="movie" value="Banners Template/Example_160x600.swf" />
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<!-- This param tag prompts users with Flash Player 6.0 r65 and higher to download the latest version of Flash Player. Delete it if you don’t want users to see the prompt. -->
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="Banners Template/Example_160x600.swf" width="160" height="600">
<!--<![endif]-->
<param name="quality" value="high" />
<param name="wmode" value="opaque" />
<param name="swfversion" value="9.0.45.0" />
<param name="expressinstall" value="Scripts/expressInstall.swf" />
<!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
<div>
<h4>Content on this page requires a newer version of Adobe Flash Player.</h4>
<p><img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" width="112" height="33" /></p>
</div>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
<script type="text/javascript">
swfobject.registerObject("FlashID");
</script>
I would like to do the following:
The Swf animation runs once through on page load(This is
currently happening)
Once user clicks a 'Replay Movie' button,
the swf it is associated with will replay until the movie finishes.
I have been trying to find some code that can utilize javascript or jQuery to either reload the contents of the object tag or replay the swf with no success. How can I replay a swf movie on jquery button click?
demo: http://jsfiddle.net/tive/Ff7Mq/
demo2: http://jsfiddle.net/tive/J6WQm/
capture the event and change the source of the file.
Or use your swf object to render the div again.
var initVideos = function () {
var divs = $("ul li a");
// bind your click event to the divs
divs.click(function (e) {
e.preventDefault(); // use this when you're triggering anchor tags
flashembed("videoArea", $(this).prop("href"));
divs.removeClass("active");
$(this).addClass("active");
});
};
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
How do I make flex only consume mouse scroll and keyboard events when it's useful, and otherwise pass it on to the browser?
I'm making a web application with hotkey support, but the application utilizes flash quite heavily in the form of justin.tv stream embeds. I'm worried that once a user presses play or stop or focuses the flash field in any other way it will eat all subsequent key events before they reach Javascript. I'm worried because I know that the YouTube flash field does this; once it's focused I can't close the browser window with CTRL+W or CTRL+Tab into another tab.
Is that unique to the YouTube flash player? If not, is there anything I can do on the Javascript side to make sure focus remains on my application, allowing my hotkeys to function?
Any additional information on the topic of Javascript key events and browser plugins would be appreciated.
PS: I am aware I can deny access to the Flash field altogether by means of an invisible div overlay, but I would prefer any user to be allowed to play/stop and control the volume of the embedded stream.
This solution has only been tested on Firefox on Windows.
The main problem seems to be removing keyboard focus from Flash. Setting focus to Flash has some solutions on SO already.
After some playing around, I figured out that using jQuery (latest), you can direct focus to a form's text box, which will seize the control of keyboard input from Flash. The solution follows this process:
ExternalInterface in Flash sends a command to javascript
Javascript (using jQuery in this example) sets focus to a form text field
Javascript removes focus from Flash (using this SO method to get to the Flash object)
Here is AS3 code. (I set this up in the Flash IDE, so you will have to adjust it if using external AS3 files):
import flash.events.KeyboardEvent;
stage.addEventListener(KeyboardEvent.KEY_DOWN, displayKey);
function displayKey(keyEvent:KeyboardEvent) {
/* You can use this commented code for limiting the keys that change focus. */
/*
var modifier:String="";
var keyPressed:String="";
if (keyEvent.ctrlKey) {
modifier="Ctrl + ";
} else if (keyEvent.altKey) {
modifier="Alt + ";
} else if (keyEvent.shiftKey) {
modifier="Shift + ";
}
keyPressed=keyEvent.keyCode.toString();
// make sure to add a textfield to the stage, and name it "myTextField" to make this line work:
myTextField.text= modifier + keyPressed;
*/
if (ExternalInterface.available) {
// Limit the keystrokes using javascript by using this method:
// ExternalInterface.call("sendToJavaScript", modifier + keyPressed );
// Any keystroke will unfocus:
ExternalInterface.call("sendToJavaScript", "");
}
}
Sample HTML/Javascript code follows; you will need swfobject.js file in the same directory. Note that the id for the Flash element is the default from the Flash IDE, and the id for the text input is text1.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>testFocus</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style type="text/css" media="screen">
html, body { height:100%; background-color: #ffffff;}
body { margin:0; padding:0; }
#flashContent { width:100%; height:100%; }
.focus {
border: 10px solid #00ffff;
background-color: #ff0000;
}
</style>
<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js" charset="utf-8"></script>
</head>
<body>
<div id="outerdiv"><form id="form1">
<input type="text" value="hmmm" id="text1">test</input>
</form>
</div>
<div id="flashContent">
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="1024" height="768" id="testFocus" align="middle">
<param name="movie" value="testFocus.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#0033ff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="testFocus.swf" width="1024" height="768">
<param name="movie" value="testFocus.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#0033ff" />
<param name="play" value="true" />
<param name="loop" value="true" />
<param name="wmode" value="window" />
<param name="scale" value="showall" />
<param name="menu" value="true" />
<param name="devicefont" value="false" />
<param name="salign" value="" />
<param name="allowScriptAccess" value="sameDomain" />
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflash">
<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
</a>
<!--[if !IE]>-->
</object>
<!--<![endif]-->
</object>
</div>
<script language="JavaScript">
$(document).ready(function() {
// just for kicks:
$('#text1').blur(function(){
$(this).removeClass("focus");
});
// handles form's text input focus (referenced by element's id):
$('#text1').focus(function() {
//alert('Handler for .focus() called.');
$(this).addClass("focus");
removeFocusOnFlash();
});
});
function removeFocusOnFlash() {
// Find the Flash container:
var f = $('#flashContent');
if (f) {
// Hide flash:
f.tabIndex = 0;
f.blur();
f.removeClass("focus");
}
}
// This is called by the Flash file:
function sendToJavaScript(value) {
// set focus on the form's text input field:
$('#text1').focus();
}
</script>
</body>
</html>
Unless Flash is activated through user interaction, it doesn't receive key events. However, once it happens, it doesn't retransmit key events to DOM. Unfortunately, even though you could trap all keys in JavaScript, you wouldn't be able in general to notify Flash when you choose too. Flash won't also receive focus through tabbing, but once it has focus, will not transfer it back to the page. There are only certain key combinations that you can't listen to in Flash (because they are handled by the browser), such as Ctrl+O for example.
But if you have control over the code executed in Flash (at least, you have to be able to load foreign SWF into your own SWF), then you could pass keystrokes to it and from it. I'm not sure about the tabstops. I think it would depend on the browser and whether it allows JavaScript to call focus().
Here's a demo, it is for the right mouse click only, but it would be similar for other key/mouse events.