Re: WMP v.11 - Audio but no Video



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

  • Re: Attempt to de-mystify AJAX
    ... > page load is a slow, heavy process - and, as others have pointed out, ... Tools that compress javascript (typically limiting which browsers ... The tools that I have seen that make a cache in the browser are all ... Good musing. ...
    (comp.databases.pick)
  • Re: dynamically associate radio buttons with droplists
    ... update automatically to load the contents of the associated file. ... JavaScript in order to do debugging). ... you need to have code run in the browser, ... support Python. ...
    (comp.lang.python)
  • Re: mpg doesnt play in IE - windows media player at first load
    ... Controlling the player with a JavaScript? ... By the media content. ... Several products from ISS, on the network layer, not inside the browser. ...
    (microsoft.public.windowsmedia.player.web)
  • Re: WMP v.11 - Audio but no Video
    ... permit "javascript debugging" and you will immediately see the errors. ... To turn on debugging in IE browser, go to the menu ... player displays at the requested width x height. ... available to the DOM until the page load is complete, ...
    (microsoft.public.windowsmedia.player.web)
  • Re: How to update the current web page? (delete current web page + rewrite the page)
    ... So When user clicks one of these 'Load' button, ... that the browser normally created during the process. ... never submit any data to the server so that it can draw a new page. ... Those user who has javascript disabled will see the whole history ...
    (comp.lang.javascript)

Loading