Jump to content

Recommended Posts

Hello, I am trying to create a dynamic playlist using php and mysql. I used the header Content-Type: video/x-ms-asf to ask the browser to open the content using windows media player, will this work all the time ? and also do you know what is the mime type or content-type for real one video ?

 

the below code is cotained in the file such as www.example.com/playlist.php

so user can request for certain video like this www.example.com/playlist.php?i=888

 

so if the

 

<?php
require_once('database.php');
if(isset($_GET['i'])){
$result = mysql_query('SELECT playerType, url FROM playlist WHERE id='.$_GET['i'],$db->connection) or die(mysql_error());
if(mysql_num_rows($result) > 0){	
	$r = mysql_fetch_assoc($result);
	if($r['playerType'] == 'wmp'){
	header("Content-Type: video/x-ms-asf");
echo "
<ASX Version='3'>
<title>video name</title>
<ENTRY>
<REF HREF=".$r['url']."/>
</ENTRY>
</ASX>";
	}		

	else if($r['player'] == 'realOne'){
		header("Content-Type: "); // I am not sure what is the mime type for real one player.
		echo $r['url'];
	}
}
}
?>

Thanks for your reply, mime type for real I find out from you audio/x-pn-realaudio, does it ideally work on audio only ? or not problem on video too ? currently it works, but  i am afraid if it does not work in certain browser, i have not find any problem YET though.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.