Solved

put mpg on web page

Posted on 2009-03-30
9
957 Views
Last Modified: 2013-11-19
Can someone give a the correct markup to place an MPG video onto a web page that will work cross browser and cross platform?

<object ....
    <embed...

0
Comment
Question by:Hube02
9 Comments
 
LVL 15

Accepted Solution

by:
Tomarse111 earned 250 total points
ID: 24018688
Below is an example of using a MPG in a html page with all relevant params:
 <OBJECT id=WindowsMediaPlayer1 width=320 height=264 hspace=5 
            vspace=5 classid=clsid:6BF52A52-394A-11D3-B153-00C04F79FAA6 border="5" align="middle">
              <param name="URL" value="jogi.mpg" ref>
              <param name="rate" value="1">
              <param name="balance" value="0">
              <param name="currentPosition" value="0">
              <param name="defaultFrame" value>
              <param name="playCount" value="1">
              <param name="autoStart" value="-1">
              <param name="currentMarker" value="0">
              <param name="invokeURLs" value="-1">
              <param name="baseURL" value>
              <param name="volume" value="50">
              <param name="mute" value="0">
              <param name="uiMode" value="full">
              <param name="stretchToFit" value="-1">
              <param name="windowlessVideo" value="0">
              <param name="enabled" value="-1">
              <param name="enableContextMenu" value="-1">
              <param name="fullScreen" value="0">
              <param name="SAMIStyle" value>
              <param name="SAMILang" value>
              <param name="SAMIFilename" value>
              <param name="captioningID" value>
              <param name="enableErrorDialogs" value="0">
              <param name="_cx" value="9260">
              <param name="_cy" value="9790">
<EMBED type='application/x-mplayer2'
        pluginspage='http://microsoft.com/windows/mediaplayer/en/download/'
        id='mediaPlayer' name='mediaPlayer' displaysize='4' autosize='-1' 
        bgcolor='darkblue' showcontrols="true" showtracker='-1' 
        showdisplay='0' showstatusbar='-1' videoborder3d='-1' width="320" height="264"
        src="jogi.mpg" autostart="true" designtimesp='5311'>
      </EMBED>
</OBJECT>

Open in new window

0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24018692
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24018698
Will windows media player work on a amc?  Thought you needed to go flash for this.
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 40

Assisted Solution

by:Kyle Abrahams
Kyle Abrahams earned 250 total points
ID: 24018723
0
 
LVL 51

Expert Comment

by:Ryan Chong
ID: 24018812
>>cross browser and cross platform?

try customize this example that using M$ Media Player....

tested working in IE6/7 and FF3.



<SCRIPT type="text/javascript">

    function createMediaPlayer(id, width, height, url, autostart, playcount, showdisplay, showstatusbar) {
      if(-1 != navigator.userAgent.indexOf("MSIE"))
      {
        document.write('<OBJECT id="'+id+'"');
        document.write(' classid="clsid:6BF52A52-394A-11d3-B153-00C04F79FAA6"');
        document.write(' width='+width+' height='+height+'>');
        document.write(' <param name="URL" value="'+url+'">');
            document.write(' <param name="AutoStart" value="'+autostart+'">');
            document.write(' <param name="PlayCount" value="'+playcount+'">');
            document.write(' <param name="ShowDisplay" value="'+showdisplay+'">');
            document.write(' <param name="ShowStatusBar" value="'+showstatusbar+'">');
        document.write('</OBJECT>');
      }
      else if(-1 != navigator.userAgent.indexOf("Firefox"))
      {
        document.write('<OBJECT id="'+id+'"');
        document.write(' type="application/x-ms-wmp"');
        document.write(' width='+width+' height='+height+'>');
        document.write(' <param name="URL" value="'+url+'">');
        document.write(' <param name="AutoStart" value="'+autostart+'">');
        document.write(' <param name="PlayCount" value="'+playcount+'">');
        document.write(' <param name="ShowDisplay" value="'+showdisplay+'">');
        document.write(' <param name="ShowStatusBar" value="'+showstatusbar+'">');
        document.write('</OBJECT>');
      }
    }

    </SCRIPT>


then:

<script language="javascript">
          createMediaPlayer("media1", 480, 320, "mms://xxx.xxx.xxx.xxx/myChannel/Content/Users/blabla/media/myvideo.mpg", 0, 1, 1, 0);
    </script>



hope this helps too.
0
 
LVL 18

Author Comment

by:Hube02
ID: 24018963
I'm running into the same problem with all of these example. Firefox works fine. In IE the page loads forever and never loads. This is not something the client wants to put on youtube, so that is not an option. I need to be able to play the mpg file and have controls and it needs to work in all browsers.

Using the quicktime plugin is the option I would go for as this is something that many people already have installed. Windows Media player is not an option.

Like I said, I can get this to work in FF but I get nothing in IE
0
 
LVL 18

Author Closing Comment

by:Hube02
ID: 31564317
Got it working
0
 
LVL 40

Expert Comment

by:Kyle Abrahams
ID: 24019653
can you post the final source for other people?
0
 
LVL 18

Author Comment

by:Hube02
ID: 24019763
This is what I ended up using in the end. Not completely what I was looking for, but it works and this needed to be done in a hurry.



<object id="Video1" type="application/x-mplayer2" width="320" height="320">
	<param name="fileName" value="images/video.mpg">
	<param name="autoStart" value="false">
	<param name="showControls" value="true">
	<embed type="application/x-mplayer2" src="images/video.mpg" name="Video1" autostart="false" showcontrols="true" 
					width="320" height="320">
</object>

Open in new window

0

Featured Post

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Else condition 9 23
Html value of radio 14 29
html border input line 7 14
Local HTML file to display local Access MDB data in browser 4 27
Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
In this tutorial viewers will learn how to embed Flash content in a webpage using HTML5. Ensure your DOCTYPE declaration is set to HTML5: "<!DOCTYPE html>": Use the <object> tag to embed Flash content.: To specify that the object is Flash content, d…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

837 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question