Solved

Streaming video for cross-browsers

Posted on 2008-09-30
4
243 Views
Last Modified: 2013-11-19
I can't believe I can't find an answer for this.  I would like to live stream a series of videos that can be launched from Explorer OR Firefox or Safari, etc.  I used to have two formats, wmv and mov with a form so the user could select if they want to run it in Windows or Quicktime.  But I'd rather avoid that step and have one format.

So i now have a site with mpg1 files, which is ok, and runs in various video players, but I don't have control over the size.  If I set the size in height/width, it may or may not have controls at the bottom that will make it less high and then stretch it sideways.

I would like to turn the controls off, or at least control the size.  I currently have the following simple embed tag.

Do I need to check for player type (media player, Quicktime) and modify my code accordingly, or is there a way to set the size and controllers?  

<embed src='video/<? echo $_GET['vid'] ?>.mpg' controller='true' controls='false' loop='false' autostart='true' ></embed>

Open in new window

0
Comment
Question by:dougfosterNYC
  • 4
4 Comments
 

Author Comment

by:dougfosterNYC
ID: 22610983
0
 

Author Comment

by:dougfosterNYC
ID: 22613517
Is this too hard a question?  I've maxed the point value.
0
 

Accepted Solution

by:
dougfosterNYC earned 0 total points
ID: 22623855
I will answer my own question.  Video issues seem to be a weakpoint here on EE.  I am using MOV files and MPEG1 files, both work with the code below.  It uses Quicktime as a player, which most people have, I believe, even on Windows/IE machines.  
I haven't tested it with a machine without QT.  
But having the <object> tag, which is proper, and the <embed> tag within for browsers not understanding the object tab, should handle all situations.

<? if (isset($_GET["thewidth"])){

		$thewidth = $_GET["thewidth"];

		$theheight = $_GET["theheight"]+15;

	} else {

		$thewidth = 352;

		$theheight = 244;	} ?>

................

	<OBJECT CLASSID="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="<? echo $thewidth; ?>" HEIGHT="<? echo $theheight; ?>" 

	CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">

		<PARAM NAME="src" VALUE="video/<? echo $_GET['vid']; ?>">

		<PARAM NAME="autoplay" VALUE="true">

		<PARAM NAME="controller" VALUE="true">

		<PARAM NAME="loop" VALUE="false">

		<EMBED SRC="video/<? echo $_GET['vid']; ?>" WIDTH="<? echo $thewidth; ?>" HEIGHT="<? echo $theheight; ?>" 

			AUTOPLAY="true" CONTROLLER="true" LOOP="false" PLUGINSPAGE="http://www.apple.com/quicktime/">

		</EMBED>

	</OBJECT>

Open in new window

0
 

Author Comment

by:dougfosterNYC
ID: 22623894
One other comment.  Notice that I add 15 pixels to the height.  This is necessary so you can see the controls at the bottom.  I came to 15 pixels through trial by error. I don't know if there is a "proper" number.
An odd way to deal with the situation, but it seems to work.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Introduction Since I wrote the original article about Handling Date and Time in PHP and MySQL (http://www.experts-exchange.com/articles/201/Handling-Date-and-Time-in-PHP-and-MySQL.html) several years ago, it seemed like now was a good time to updat…
Styling your websites can become very complex. Here I'll show how SASS can help you better organize, maintain and reuse your CSS code.
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
In addition to being a great web-based presentation tool, Prezi also makes it easy to save your presentation as a PDF to share with others as well. Learn how in this tutorial. Select the share icon from the top menu in your Prezi editor: Select "D…

760 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now