how to mute the .swf video while playing? - xhtml

Actually i tried the below HTML command for mute the flash video.
enter code here
<HTML>
<HEAD>
<meta http-equiv=Content-Type content="text/html; charset=ISO-8859-1">
<TITLE>Sound OFF</TITLE>
</HEAD>
<BODY bgcolor="#FFFFFF">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" WIDTH="500" HEIGHT="200" id="header123" ALIGN="">
<PARAM NAME=movie VALUE="file:///opt/python/data/107.swf?playSound=var_stop">
<PARAM NAME=quality VALUE=high>
<PARAM NAME=bgcolor VALUE=#FFFFFF>
<EMBED src="file:///opt/python/data/107.swf?playSound=var_stop" quality=high bgcolor=#FFFFFF WIDTH="500" HEIGHT="200" NAME="header123" ALIGN="" TYPE="application/x-shockwave-flash">
</EMBED>
</OBJECT>
</BODY>
</HTML>

Afaik, you cant mute a Flash Video over HTML, unless the developer implemented a parameter for it inside of the Flash.
playSound=var_stop could work, if this parameter is handled inside of the Flash - but probably it's not.
You will have to change the flash so that it can handle a parameter for this.

var tt=[];
tt=document.getElementsByTagName('object');
for (i in tt) {
try {
typeof tt[i] == 'function' && tt[i].mute();
} catch (err) {
}
}
it stop all object sound on current page . It work for me

Related

Background color with variations

Is there a way to get this background color without setting the image as background? I want to know if there is a way to add those shadows, besides doing background-color:cyan.
Yes you can do this by using Power bullet presentation as per my knowledge ...
Here you can choose any colour and you can get this colour as HTML code ...
like I get this one as
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<META http-equiv=Content-Type content="text/html; charset=windows-1252">
<script type="text/javascript">
<!--
var InternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
function powerbullet_DoFSCommand(command, args) {
var map = InternetExplorer ? powerbullet : document.powerbullet;
if (command=="home" )
map.Rewind();
else if ( command=="zoom" )
map.Zoom(parseInt(args));
else if (command == "message")
alert(args);
else if (command == "pan")
map.Pan(parseInt(args));
else if (command == "parse")
eval(args);
}
//--></script>
<SCRIPT LANGUAGE="VBScript">
<!--
Sub powerbullet_FSCommand(ByVal command, ByVal args)
call powerbullet_DoFSCommand(command, args)
end sub
-->
</SCRIPT>
<script type="text/javascript">
<!--
function Nothing(){
}
//--> </script>
<style type="text/css">
body {text-align:center;}
div.center {text-align:center;margin-right:auto;margin-left:auto;}
</style>
</HEAD>
<BODY onLoad="Nothing()" bgcolor=#FFFFFF leftmargin="0" topmargin="0" rightmargin="0" bottommargin="0">
<div class="center">
<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ID="powerbullet"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#4,0,0,0"
WIDTH=760px HEIGHT=497px>
<PARAM name=movie VALUE="__PREVIEW.swf">
<PARAM NAME=menu VALUE=false> <PARAM NAME=quality VALUE=high>
<PARAM NAME=scale VALUE=exactfit> <PARAM NAME=wmode VALUE=opaque>
<EMBED NAME="powerbullet" WIDTH=760px HEIGHT=497px src="__PREVIEW.swf"
menu=false quality=high scale=exactfit wmode=opaque
TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></EMBED>
</object>
</div>
<center> </center>
</BODY>
</HTML>
And the colour you get by this code is as it is showing less darkness but it can be adjusted:
You can download powerbullet from here : http://powerbullet.com

Flex app loads in ie/chrome but not in firefox (hosted on Azure)

What I'm seeing is the browser loads the html and shows a blank white page. If I change the swfobject background color to black, I see the black square. For larger swf's I see a progress bar that proceeds to 100% and then just stops.
I boiled this down to a simple hello world app and it still fails for me. It only seems to fail when the SWF file is served by a hosted web server instance on Azure. Oddly when loading the html directly into the browser from the file system it works - just not when hosted on Azure. It also fails when running the emulator. I just tried putting the file into blob storage and that works perfectly in all browsers. I have not tried the file on another host.
Here is the html - very plain and generic. All generated from flash builder. Ignore the fact that it is called ClientPreloader.swf - I've removed all functionality now so it is just a single label on the stage.
As for Azure, it is hosted on SP2 and I have not made any changes to the running IE.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0014)about:internet -->
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<!--
Smart developers always View Source.
This application was built using Adobe Flex, an open source framework
for building rich Internet applications that get delivered via the
Flash Player or to desktops via Adobe AIR.
Learn more about Flex at http://flex.org
// -->
<head>
<title></title>
<meta name="google" value="notranslate" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Include CSS to eliminate any default margins/padding and set the height of the html element and
the body element to 100%, because Firefox, or any Gecko based browser, interprets percentage as
the percentage of the height of its parent container, which has to be set explicitly. Fix for
Firefox 3.6 focus border issues. Initially, don't display flashContent div so it won't show
if JavaScript disabled.
-->
<style type="text/css" media="screen">
html, body { height:100%; }
body { margin:0; padding:0; overflow:auto; text-align:center;
background-color: #ffffff; }
object:focus { outline:none; }
#flashContent { display:none; }
</style>
<!-- Enable Browser History by replacing useBrowserHistory tokens with two hyphens -->
<!-- BEGIN Browser History required section -->
<link rel="stylesheet" type="text/css" href="history/history.css" />
<script type="text/javascript" src="history/history.js"></script>
<!-- END Browser History required section -->
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
// For version detection, set to min. required Flash Player version, or 0 (or 0.0.0), for no version detection.
var swfVersionStr = "11.1.0";
// To use express install, set to playerProductInstall.swf, otherwise the empty string.
var xiSwfUrlStr = "playerProductInstall.swf";
var flashvars = {};
var params = {};
params.quality = "high";
params.bgcolor = "#ffffff";
params.allowscriptaccess = "sameDomain";
params.allowfullscreen = "true";
var attributes = {};
attributes.id = "ClientPreloader";
attributes.name = "ClientPreloader";
attributes.align = "middle";
swfobject.embedSWF(
"ClientPreloader.swf", "flashContent",
"100%", "100%",
swfVersionStr, xiSwfUrlStr,
flashvars, params, attributes);
// JavaScript enabled so display the flashContent div in case it is not replaced with a swf object.
swfobject.createCSS("#flashContent", "display:block;text-align:left;");
</script>
</head>
<body>
<!-- SWFObject's dynamic embed method replaces this alternative HTML content with Flash content when enough
JavaScript and Flash plug-in support is available. The div is initially hidden so that it doesn't show
when JavaScript is disabled.
-->
<div id="flashContent">
<p>
To view this page ensure that Adobe Flash Player version
11.1.0 or greater is installed.
</p>
<script type="text/javascript">
var pageHost = ((document.location.protocol == "https:") ? "https://" : "http://");
document.write("<a href='http://www.adobe.com/go/getflashplayer'><img src='"
+ pageHost + "www.adobe.com/images/shared/download_buttons/get_flash_player.gif' alt='Get
Adobe Flash player' /></a>" );
</script>
</div>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="100%" height="100%" id="ClientPreloader">
<param name="movie" value="ClientPreloader.swf" />
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--[if !IE]>-->
<object type="application/x-shockwave-flash" data="ClientPreloader.swf" width="100%" height="100%">
<param name="quality" value="high" />
<param name="bgcolor" value="#ffffff" />
<param name="allowScriptAccess" value="sameDomain" />
<param name="allowFullScreen" value="true" />
<!--<![endif]-->
<!--[if gte IE 6]>-->
<p>
Either scripts and active content are not permitted to run or Adobe Flash Player version
11.1.0 or greater is not installed.
</p>
<!--<![endif]-->
<a href="http://www.adobe.com/go/getflashplayer">
<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>
</noscript>
</body>
</html>
The real answer to this questing seems to be "don't do that". I'm disappointed not to see any responses here. My scientific approach to Azure ended up biting me. I was trying to take on one feature at a time (hosted IE, then storage, etc). The key to getting it to work is doing everything. You need to embrace all of Azure. Granted there is an obvious defect in the hosted IIS related to the SWF file. But if you follow the recommendations fully - put large files in storage, etc. It all works smoothly (faster even).

Can an HTML object tag be placed inside an HTML form tag?

I have a simple ASP.NET page that uses the VLC media player to play a video in IE. I also have four buttons to control the playback:
Play, Pause, Stop, and Mute
The four buttons call JavaScript functions that access the ActiveX control. When I click on any of the buttons, I get the following error in the JavaScript function:
"Microsoft JScript runtime error: 'vlc' is undefined".
However, if move the object tag for the vlc player outside the form tag, then the JavaScript works correctly, and I can control the video playback.
My question is why must the object tag be outside the form tag for this code to work correctly?
<%# Page Language="C#" AutoEventWireup="true"
CodeBehind="Default.aspx.cs" Inherits="VlcTest.Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>VLC Test Page</title>
<script type="text/javascript">
function mute() {
vlc.audio.toggleMute();
}
function play() {
vlc.playlist.play();
}
function stop() {
vlc.playlist.stop();
}
function pause() {
vlc.playlist.togglePause();
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<object type="application/x-vlc-plugin"
id="vlc"
width="720"
height="548"
classid="clsid:9BE31822-FDAD-461B-AD51-BE1D1C159921" >
<param name="MRL"
value="C:\Inetpub\wwwroot\Movies\Funny Cats.flv" />
<param name="volume" value="50" />
<param name="autoplay" value="false" />
<param name="loop" value="false" />
<param name="fullscreen" value="false" />
</object>
<br />
<div id="controls">
<input type="button" onclick="play()" value="Play" />
<input type="button" onclick="pause()" value="Pause" />
<input type="button" onclick="stop()" value="Stop" />
<input type="button" onclick="mute()" value="Mute" />
</div>
</div>
</form>
</body>
</html>
The problem is that inside the <form> tag the <object> element is out of scope.
Try using:
function play() {
var player = document.getElementById("vlc");
player.playlist.play();
}

Using Object tags in asp.net

I have this html code for embedding a video in an aspx page:
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="videofilename.wmv">
<PARAM name="autostart" VALUE="false">
<PARAM name="ShowControls" VALUE="true">
<param name="ShowStatusBar" value="false">
<PARAM name="ShowDisplay" VALUE="false">
<EMBED TYPE="application/x-mplayer2" SRC="videofilename.wmv" NAME="MediaPlayer"
WIDTH="192" HEIGHT="190" ShowControls="1" ShowStatusBar="0" ShowDisplay="0" autostart="0"> </EMBED>
</OBJECT>
The thing is, I want to set its parameters from my C# code-behind (f.e., the path to the file to be played).
I know I should add runat="server" but that's not the only thing. The code-behind doesn't recognize any element of the type MediaPlayer no matter what. (I'm trying to access it from my Page_Load(..))
How should I do this?
10x
Create a HtmlGenericControl. You can set the attributes through the Attributes property via your codebehind. And add the sub-elements through Controls.
HtmlGenericControl obj = new HtmlGenericControl("object");
HtmlGenericControl embedTag = new HtmlGenericControl("embed");
embedTag.Attributes["type"] = "application/x-mplayer2";
obj.Controls.Add(embedTag);
flashPlaceHolder.Controls.Add(obj);
There is no ASP.NET control for the OBJECT tag, so you have to generate its HTML yourself. There are two simple ways to do this. The first way is to use <% %> tags in your ASPX file, like this:
<OBJECT ID="MediaPlayer" WIDTH="192" HEIGHT="190" CLASSID="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95"
STANDBY="Loading Windows Media Player components..." TYPE="application/x-oleobject">
<PARAM NAME="FileName" VALUE="<% =FileName %>">
...
</OBJECT>
The other way is to create a LiteralControl in your codebehind, and set its HTML to whatever you want:
LiteralControl myObject = new LiteralControl();
myObject.Text =
#"<OBJECT ID='MediaPlayer' WIDTH='192' HEIGHT='190' CLASSID='CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95' STANDBY='Loading Windows Media Player components...' TYPE='application/x-oleobject'>
<PARAM NAME='FileName' VALUE='" + FileName + "'>
...
</OBJECT>';";
Page.Controls.Add(myObject);

how to play and stop sound control by javascript in wmplayer?

how to play and stop sound control by javascript in wmplayer in asp.net ?
You can embed the windows media player in an HTML page and then use javascript to manipulate the object.
They have properties for volume, balance and methods to mute.
http://msdn.microsoft.com/en-us/library/dd564581(VS.85).aspx
EDIT:
Here's another good reference: http://www.mioplanet.com/rsc/embed_mediaplayer.htm
<script type="text/javascript">
function doThings(n) {
if(n==1)
document.getElementById('VIDEO').controls.play();
else
if(n==2)
document.getElementById('VIDEO').controls.stop();
}
</script>
<OBJECT id="VIDEO" width="320" height="240"
CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6"
type="application/x-oleobject">
<PARAM NAME="URL" VALUE="town.mid">
<PARAM NAME="SendPlayStateChangeEvents" VALUE="True">
<PARAM NAME="AutoStart" VALUE="False">
<PARAM name="uiMode" value="none">
<PARAM name="PlayCount" value="9999">
</OBJECT>
<input type="button" value="start" onclick="doThings(1)"/>
<input type="button" value="stop" onclick="doThings(2)"/>

Resources