• Posiblemente dispongas de un vídeo que quieras colocar mediante "Media Player" en tu web (no estamos hablando por ejemplo de los vídeos de Youtube, cuya colocación ya expliqué en otro tema), por ejemplo un video-tutorial que hayas preparado. En este caso voy a explicar la forma de colocar uno con la extensión ".wmv", pero igualmente te podría valer para un ".avi" u otros. • Te lo explico a continuación...
• Como podrás observar a continuación, es sencillo el colocar dicho vídeo en cualquier tema que crees en tu web. Para ello tan solo debes colocar el siguiente código: <object classid ="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase ="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" type="application/x-oleobject"" width ="416" height ="308" align="middle" standby ="Loading Microsoft Windows Media Player components" id="mediaPlayer" viewastext""> <param name="autoStart" value="true" /> <param name="url" value="TTT/amsterdam.wmv" /> <param name="wmode" value="transparent" /> <param name="uiMode" value="full" /> <param name="loop" value="false" /> <span class="Estilo37"> <script language="JavaScript" type="text/javascript"> { ////////////////////////////////// // the subfolder and file name - these are used only on the mozilla browser var videosubdirectory = "/"; var videofile = "TTT/amsterdam.wmv"; //this will be the final video link (absolute path) var videolink = location.href; //remove the file:// because windows media doesn't understand that var file = videolink.indexOf( "file://"); if ( file >-1 ) { // THIS IS A LOCAL PATH videolink = videolink.substring( file + 8 ); //remove the %20 because media player doesn't understand those while( videolink.lastIndexOf( "%20" ) != -1 ) { videolink = videolink.replace( "%20", " " ); } //remove the html file name now var lastslash = videolink.lastIndexOf( "/"); if ( lastslash > -1 ) videolink = videolink.substring( 0, lastslash ); //add the subfolder (if there is one) and then the video file name if ( videosubdirectory.length > 0 ) videolink = videolink + "/" + videosubdirectory + "/" + videofile; else videolink = videolink + "/" + videofile; } else { //////////////////////////// // THIS IS NOT A LOCAL FILE - give relative path //no need to give an absolute path if ( videosubdirectory.length > 0 ) videolink = videosubdirectory + "/" + videofile; else videolink = videofile; } //write out the mozilla complient code document.write( "<EMBED NAME =\"EmbedmediaPlayer\""); document.write( "TYPE =\"application/x-mplayer2\" "); document.write( "SRC =\"" + videolink + "\""); document.write( "WIDTH =\"262\" "); document.write( "HEIGHT =\"258\"> "); document.write( "</EMBED>" ); } </script> </span> <noscript> <span class="Estilo37"> <embed src ="TTT/amsterdam.wmv" width ="416" height ="308" align="middle" type ="application/x-mplayer2"> </embed> </span> </noscript> </object>
• Tan solo tendrás que colocar en los tres apartados que te señalo en rojo, la ruta completa donde tengas cargado el referido vídeo en tu servidor. Para insertar este código en tu artículo, usa la opción "HTML" de tu editor. • Es todo, espero te haya servido. Saludos |