Re: WMP v.11 - Audio but no Video



I turned on the debuggin inIE, and solve the little mistakes in the code,
and the video plays as before in a size unchangeable (can't change!!) .

Is possible to force a WMV file independently of it aspect size, to show it
in another width and height?

The videos is 640 x 480 and I would like to show it at: 225 x 555 (for
example)

Im going crazy with this... :S!!

Thank Neil,

Arnau.

--

Arnau Campamà
Conseller Delegat - Cine a la carta

"Neil Smith [MVP Digital Media]" <neil@xxxxxxxxxx> escribió en el mensaje
news:h6f5g3l6nlqbgrugqkdfbkj8aj3g07ndc7@xxxxxxxxxx
On Tue, 2 Oct 2007 19:10:19 +0200, "Arnau" <acampama@xxxxxxxxxxxxxxxx>
wrote:

Now you have posted the code, it is possible to discover why it does
not work. Please ensure in Internet Explorer (or Firefox) that you
permit "javascript debugging" and you will immediately see the errors.

To turn on debugging in IE browser, go to the menu (in English :)

Tools -> Internet Options -> Advanced

Deselect (un-tick) this option : 'Disable script debugging'
Select (tick) this option : 'Display a notification about every script
error'



Could you help me in changing the windows media player resolution in a
website. I asked it some days ago, but didnt got response.

I paste all the code here:

<script language="javascript">

var volumAra; // variable que emmagatzema el volum en cada moment

////////////////////CREACIO DEL COMPONENT REPRODUCTOR WINDOWS MEDIA
PLAYER ////////////////////////////////////

document.writeln('<OBJECT ID=Player
classid=clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6 height=225
width=455>');
// 225 x 455 nou | 308 x 581 original
document.writeln('<PARAM name=URL value='xxxx.wmv'');

________________^______________________^_______^^


This line contains single quotes ' and must use double quotes.
So it *must* be written like this, because javascript is in error :

document.writeln("<PARAM name=URL value='xxxx.wmv' ");


document.writeln('<PARAM name=autoStart value=true>');
document.writeln('</OBJECT>')

___________________________^


This line *must* end with a semi-colon character.
So it *must* be written like this :

document.writeln('</OBJECT>');



If those errors are corrected, the HTML output is correct and so the
player displays at the requested width x height. If the HTML is
broken, the browser *tries* to display the player, but the embedding
code is invalid and so it uses WMP at the default settings and size.


Now on to the remaining javascript : Your Player object is (1) not
available to the DOM (web browser) until the page load is complete,
and (2) is not referenced using the object ID directly - you should
use the W3C DOM reference to load the player ID as a javascript object

So you cannot use these lines

document.Player.uiMode="none";
document.Player.stretchToFit="true";
document.Player.VideoBorderWidth=0;
document.Player.enableContextMenu=0;
document.Player.settings.volume=80;


Instead, use those in a separate javascript *after* the <script />
element used to createthe player. Load that after the document is
loaded, in IE you can use defer="true" to defer script loading :


<script type="text/javascript" defer="true">
WMayer = document.getElementById("Player");
WMPlayer.uiMode="none";
WMPlayer.stretchToFit="true";
WMPlayer.VideoBorderWidth=0;
WMPlayer.enableContextMenu=0;
WMPlayer.settings.volume=80;
</script>

Cheers - Neil
------------------------------------------------
Digital Media MVP : 2004-2007
http://mvp.support.microsoft.com/mvpfaqs




.



Relevant Pages


Quantcast