Avatar billede christianb Nybegynder
30. juni 2002 - 22:46 Der er 9 kommentarer og
3 løsninger

HTML-vindue med windows medieplayer

Jeg vil gerne lave en HTML-side som indeholder windows medieplayer (integreret i HTML-siden). Jeg har linket til WMV-filen, men når jeg via frontpage laver mit windows-medieplayer-objekt sætter den version 6 ind og jeg har brug for version 7 (den nyeste).
Hvordan kan jeg få frontpage til at indsætte den rigtige version eller hvordan kan jeg indsætte mediaplayeren manuelt????
>christian B
Avatar billede krogstrup Nybegynder
30. juni 2002 - 22:51 #1
Prøv evt. at "tage" koden fra denne side:

www.bruglaaget.dk under punktet "Grillskole"

:-)
Avatar billede krogstrup Nybegynder
30. juni 2002 - 22:52 #2
Grillskole hedder vist i stedet "Grill TV"

Desuden kan jeg se at "video-serveren" er nede i øjeblikket - videoerne bliver derfor ikke afspillet, men jeg ved at HTML-koden er korrekt !
Avatar billede christianb Nybegynder
30. juni 2002 - 23:04 #3
Så vidt jeg kan se bruger de medieplayer 6 og ikke 7  ???!!
>Christian B
Avatar billede tubber Juniormester
30. juni 2002 - 23:20 #4
Den bruger den mediaplayer brugeren har installeret (wmp 7 kan jo også sættes til classic), men er det en mov fil så bliver vinduet til quicktime vinduet......

<EMBED SRC="minvideo.format">

og lige lidt læsestof (godt nok på engelsk):

The <EMBED> element allows authors to embed objects directly into an HTML page

The basic syntax is:

<EMBED SRC="_URL_">
<NOEMBED>Alternative content</NOEMBED>
</EMBED>
where "_URL_" represents the URL of the object that is to be embedded. See below for a description of the <NOEMBED> element.

The <EMBED> element will allow you to embed documents, or objects of any type. Your user only needs to have an application which can view the data installed correctly on their machine, or have a plug-in (for Netscape and Internet Explorer) that can manipulate the embedded file format.

The <EMBED> element can be used more or less the same as the <IMG> element and so accepts typical image embedding attributes such as ALIGN, ALT, BORDER, WIDTH, HEIGHT, HSPACE, VSPACE and NAME (for referencing the embedded object in a script function). Note that multiple <EMBED> elements can be grouped together with the same NAME attribute value, to provide multiple separate controls for a single embedded sound file).

Plug-ins Netscape plug-ins make use of the <EMBED> element. Essentially, plug-ins are dynamic code modules which are associated with a MIME data type that the Netscape client has no native support for. When Netscape encounters an unknown data type from a server, it will search for a plug-in that is associated with that MIME type and load it, enabling viewing/transforming of the data object. There are many attributes to the <EMBED> element that are plug-in specific (for these, see the relevant plug-in documentation), but as well as the attributes above, the <EMBED> element accepts the following attributes as standard across all embedded data types.

CLASS="Style Sheet class"
The CLASS attribute is used to specify the <EMBED> element as using a particular style sheet class. See the Style Sheets topic for details.

HIDDEN="true|false"
Setting this attribute specified whether the plug-in is visible or not. Some plug-ins (like the LiveAudio plug-in) can control the embedded data type without being visible. The default value is "false", which causes the plug-in controls to be displayed.

ID="Unique identifier"
The ID attribute can be used to either reference a unique style sheet identifier, or to provide a unique name for the <EMBED> element for scripting purposes. Any <EMBED> element with an ID attribute can be directly manipulated in script by referencing its ID attribute, rather than working through the All collection to determine the element. See the Scripting introduction topic for more information.

PALETTE="foreground|background"
For users browsing in 256 colours, some embedded objects could cause what is known as 'palette flash', where palette differences between the embedded object and the browser/system cause the incorrect colours to be displayed. To avoid this, embedded objects can have their palettes expressly defined as either foreground or background (the default). 'Foreground' causes the embedded object to use the foreground palette and 'background' forces it to use the background palette (the colours not reserved by the browser/system). Note that this attribute only has effect on the Windows platforms.

PLUGINSPACE="_URL_"
If the user doesn't have a plug-in installed to handle the defined object data type (determined from the SRC attribute, or TYPE attribute value), then it is possible to guide the user to a different URL (the value of the PLUGINSPACE attribute) to provide instructions on installing the necessary plug-in module. Generally, this should be the plug-in vendors installation instructions document.

STYLE="Styling"
As well as using previously defined style sheet settings, the <EMBED> element can have in-line stylings attached to it. See the Style Sheets topic for details.

TITLE="Informational ToolTip"
The Internet Explorer 4.0 (and above) specific TITLE attribute is used for informational purposes. If present, the value of the TITLE attribute is presented as a ToolTip when the users mouse hovers over the <EMBED> section, when the embedded object doesn't provide ToolTips of its own..

TYPE="MIME type"
Either this, or the SRC attribute is necessary when inserting embedded objects into HTML documents, in order for Netscape to be able to determining a suitable plug-in module to use to handle the data type. The TYPE attribute accepts any valid MIME type, to describe the type of object being inserted.

For more information about plug-ins, see the Netscape web site. http://home.netscape.com/. Lots of plug-in modules are available, the additional attributes for which are beyond the scope of this document. The documentation with the plug-in should be consulted for useable HTML element attributes.

NOTE : Microsoft's Internet Explorer (from version 3.0 beta 2) fully supports Netscape plug-ins. When Internet Explorer loads a page designed to use a (Netscape) plug-in module, it will use either the correct plug-in, or a pre-installed ActiveX control to display the content as authored. Microsoft recently released the ActiveVRML and ActiveMovie add-ons for Internet Explorer which can handle VRML worlds, AVI, QuickTime, MPEG video/audio, WAV, Sun AU and AIFF sound files respectively, either using the respective ActiveX <OBJECT> code, or <EMBED> code as used by popular Netscape plug-ins.

Examples
Below is an embedded MIDI file. Use the control panel to play it. The code used to embed it is:

<EMBED SRC="clouds.mid" WIDTH="145" HEIGHT="61">

NOTE : Internet Explorer will use the Netscape 'LiveAudio' plug-in (if Netscape 3.0 is installed, the LiveAudio plug-in distributed with Netscape Communicator will not function inside Internet Explorer)), or any installed ActiveX control for manipulation of the above MIDI file)

Below is an embedded VRML world. Use the Live3D control panel to manipulate it. The code used to embed it is:

<EMBED SRC="../img/example.wrl" WIDTH="200" HEIGHT="150">

NOTE : Internet Explorer will use the ActiveVRML add-in (if installed), or whatever Netscape plug-in is used within Netscape to handle the above Virtual world. It will display the 'broken object' symbol if no suitable plug-in, or ActiveX control is installed.

<NOEMBED>
Much like the <NOFRAMES> element, <NOEMBED> can be used to provide alternative content for older browsers that don't understand the <EMBED> element. Older browsers will ignore the <EMBED> element (and the <NOEMBED> element to be exact), but will render any HTML content they find in between the <EMBED> and </EMBED> elements. Browsers that do understand the <EMBED> element will not render any content between the <EMBED> and </EMBED> elements. For example :

<EMBED SRC="MyWorld.wrl" WIDTH="200" HEIGHT="150">
<NOEMBED>You need Netscape or Internet Explorer to see this</NOEMBED>
</EMBED>
Netscape (from version 2.0) and Internet Explorer (from version 3.0) would embed the VRML world "MyWorld.wrl" (providing there is a suitable plug-in/ActiveX control installed), while older browsers would display the message 'You need Netscape or Internet Explorer to see this'



--------------------------------------------------------------------------------

Every <EMBED> element in a document is an object that can be manipulated through scripting. Note that most of the scripting of the <EMBED> element/object is only supported by Internet Explorer 4.0 in its Dynamic HTML object model. Netscape supports some <EMBED> related scripting through the Plug-ins array and Embeds array, but that supported by Internet Explorer is far more versatile.

<EMBED...> Properties
The <EMBED...> element/object supports all of the standard Dynamic HTML properties (i.e. className, document, id, innerHTML, innerText, isTextEdit, lang, language, offsetHeight, offsetLeft, offsetParent, offsetTop, offsetWidth, outerHTML, outerText, parentElement, parentTextEdit, sourceIndex, style, tagName and title). Details of these can be found in the standard Dynamic HTML properties topics.
The <EMBED> element also supports the following properties:
align, alt, border, hidden, height, hspace, vspace, palette, pluginspace and type
They all directly reflect their attribute settings (if any). See the particular attribute for details.

<EMBED...> Methods
The <EMBED...> element/object supports all of the standard Dynamic HTML methods (i.e. click, contains, getAttribute, insertAdjacentHTML, insertAdjacentText, removeAttribute, scrollIntoView and setAttribute). Details of these can be found in the standard Dynamic HTML Methods topics.
Also, the <EMBED> element supports the following methods:

blur
The blur method can be used to force the embedded object to lose the users focus. This then fires the onblur event (see below).

focus
The focus method can be used to force the embedded object to gain the users focus. This then fires the onfocus event (see below).

<EMBED...> Events
The <EMBED...> element/object supports all of the standard Dynamic HTML events (i.e. onclick, ondblclick, ondragstart, onfilterchange, onhelp, onkeydown, onkeypress, onkeyup, onmousedown, onmousemove, onmouseout, onmouseover, onmouseup and onselectstart). Details of these can be found in the standard Dynamic HTML events topics.
Also, the <EMBED> element supports the following events:

onblur
onblur is fired whenever the users focus moves away from the embedded object (either by them clicking on another part of the document, or by 'tabbing' away from the contents of the <EMBED> element, or by using the blur method (see above).

onfocus
The onfocus event is fired whenever the user passes the focus to the embedded object - by clicking on it, tabbing to it, or by a script function using the focus method (see above).
Avatar billede christianb Nybegynder
01. juli 2002 - 08:23 #5
tak, men EMBED sætter stadig mediplayer 6 ind selvom jeg har installeret medieplayer 7!
Jeg tror at man kan styre versionen med CLASS og ID, jeg ved bare ikke hvordan???
Avatar billede tubber Juniormester
01. juli 2002 - 09:19 #6
Der er noget her ved ikke om det kan bruges

<HTML>
<HEAD>
<TITLE>Doc JavaScript's Streaming Media JukeBox</TITLE>
<SCRIPT LANGUAGE = "JavaScript">
var streams = new Array();
streams[0] = new makeStream("http://msdn.microsoft.com/downloads/samples/Internet/imedia/netshow/smedia/NS3/JavaScript/Buttons/control.asx", "Microsoft Promo for Windows Media Player");
streams[1] = new makeStream("http://www.advintsol.com/webmaster030399/webmaster.asx", "Microsoft Training for Windows Media Player");
streams[2] = new makeStream("mms://netshow.microsoft.com/ms/sbnasfs/wmt/turtle28.asf", "The Turtle");
streams[3] = new makeStream("mms://netshow.microsoft.com/ms/sbnasfs/wmt/wmt.asf", "Flying Windows Media Player logo");

function makeStream(url, name) {
    this.url = url;
    this.name = name;
}

function handleControlsOnOffClick() {
  if (document.mediaPlayer.showControls == true) {
    document.mediaPlayer.showControls = false;
      document.playerCtrl.controls.value = "  Show Controls ";
  }
  else {
    document.mediaPlayer.showControls = true;
      document.playerCtrl.controls.value = "  Hide Controls "
  }
}

function handlePlayOrPauseClick(){
  var state;
  playerStatus = document.mediaPlayer.playState;
  if (playerStatus == 6) {
    document.mediaPlayer.play();
    document.playerCtrl.playOrPause.value = " Pause ";
  }
  else if (playerStatus == 1) {
    document.mediaPlayer.play();
    document.playerCtrl.playOrPause.value = " Pause ";
  }
  else if (playerStatus == 2) {
    document.mediaPlayer.pause();
    document.playerCtrl.playOrPause.value = " Play  ";
  }
}

function changeSize(newSize) {
  document.mediaPlayer.displaySize = newSize;
}

function change() {
  var list = document.playerCtrl.streams;
  var streamURL = list.options[list.selectedIndex].value;
  document.mediaPlayer.stop();
  document.playerCtrl.playOrPause.value = " Pause ";
  document.mediaPlayer.fileName = streamURL;
}

</SCRIPT>
</HEAD>
<BODY LEFTMARGIN = "100">
<h3>Doc JavaScript's Streaming Media JukeBox</h3><P><P><HR><P>
<OBJECT
  ID="mediaPlayer" 
  CLASSID="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95" 
  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://msdn.microsoft.com/downloads/samples/Internet/imedia/netshow/smedia/NS3/JavaScript/Buttons/control.asx">
  <PARAM NAME="animationatStart" VALUE="true">
  <PARAM NAME="transparentatStart" VALUE="true">
  <PARAM NAME="autoStart" VALUE="true">
  <PARAM NAME="showControls" VALUE="true">
</OBJECT><P>
<FORM NAME="playerCtrl">
<INPUT TYPE="button" VALUE=" Pause " NAME="playOrPause" onClick="handlePlayOrPauseClick()" STYLE = "font-family:courier">
<INPUT TYPE="button" VALUE="  Hide Controls " NAME="controls" onClick="handleControlsOnOffClick()" STYLE = "font-family:courier"><BR>
<INPUT TYPE="button" VALUE=" Small " NAME="small" onclick="changeSize(1)" STYLE="font-family:courier">
<INPUT TYPE="button" VALUE=" Normal " NAME="normal" onclick="changeSize(0)" STYLE="font-family:courier">
<INPUT TYPE="button" VALUE=" Large  " NAME="large" onclick="changeSize(2)" STYLE="font-family:courier"><BR><BR>
<SCRIPT LANGUAGE="JavaScript">
with (document) {
  writeln('<SELECT NAME="streams" onChange="change()">');
  for (var i = 0; i < streams.length; i++) {
    writeln('<OPTION VALUE="', streams[i].url, '">', streams[i].name);
  }
  writeln('</SELECT>');
}
</SCRIPT>
</FORM>
</BODY>
</HTML>
Avatar billede christianb Nybegynder
01. juli 2002 - 09:33 #7
Stadig med version 6 hmmm..

jeg laver siden med ekstern mediaplayer, på den måde åbner den i hvert fald version 7 (hvis installeret.
>Christian B
Avatar billede tubber Juniormester
01. juli 2002 - 10:03 #8
Det kunne ikke være det classid ?
Avatar billede christianb Nybegynder
01. juli 2002 - 10:11 #9
Måske, men jeg ved ikke hvor jeg får "den nye" classid.
Avatar billede tubber Juniormester
01. juli 2002 - 15:28 #10
<object id="o1" 
classid="clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6">
<PARAM NAME="defaultFrame" value="georgi">
</object>
Avatar billede christianb Nybegynder
01. juli 2002 - 16:22 #11
Jo det virker (det er ligegyldigt med "default frame"), den åbner medieplayer 7, men har man ikke den, bliver der vist en tom ramme :-(
Med den integreret løsning skal jeg ud i at lave et script der først chekker brugerens medieplayer version, og det kan jeg godt nok ikke finde ud af så jeg tror stadig jeg beholder den "eksterne" version.
> Christian B
Avatar billede tubber Juniormester
01. juli 2002 - 16:57 #12
<HTML>
<head>
<title>Detecting Windows Media Player</title>

<SCRIPT LANGUAGE="JavaScript">
<!--
var fHasWMP52 = navigator.mimeTypes && navigator.mimeTypes["application/x-
mplayer2"] &&  navigator.mimeTypes["application/x-mplayer2"].enabledPlugin;

var fHasWMP64 = navigator.mimeTypes && navigator.mimeTypes["video/x-ms-wm"]
&&  navigator.mimeTypes["video/x-ms-wm"].enabledPlugin &&
navigator.mimeTypes["video/x-ms-wmv"] && navigator.mimeTypes["video/x-ms-
wmv"].enabledPlugin;

//-->
</SCRIPT>

</head>

<body>

<OBJECT ID="NSPlay" WIDTH=1 HEIGHT=1 classid="CLSID:22d6f312-b0f6-11d0-94ab-
0080c74c7e95"
CODEBASE="#Version=6,4,5,715">
</object>

Windows Media Player is

<SCRIPT LANGUAGE="VBScript">
<!--
On error resume next

fHasWMP52 = (IsObject(CreateObject("MediaPlayer.MediaPlayer.1") ) )

fHasWMP64 = (NSPlay.FileName="")
//-->
</SCRIPT>

<SCRIPT LANGUAGE="JavaScript">
<!--
if( fHasWMP64 )
{
    document.write("version 6.4 or higher.");
}
else if( fHasWMP52 )
{
    document.write("version 5.2 or higher.");
}
else
{
    document.write( "not installed." );
}

//-->
</SCRIPT>

</BODY>
</HTML>
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester