Video STreaming issue with wmv extension
i am having a problem regarding a video streaming
here the script on the front client end side
<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="<?php echo
base_url();?>video_streaming/stream?ID='<?php
echo
$chronicle_info[0]['post_id'];?>'"
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="0">
<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="500"
height="400"
src="<?php echo
base_url();?>video_streaming/stream?ID='<?php
echo $chronicle_info[0]['post_id'];?>"
autostart="0" designtimesp='5311'>
</EMBED>
</OBJECT>
and here's the script for the backend side
class video_streaming extends CI_Controller{
public function __construct() {
parent::__construct();
@session_start();
$this->load->library('encrypt');
//$this->load->model('fileupload_model');
}
function stream()
{
if (! preg_match('/^[-a-z.-@,\'\s]*$/i',$_GET['ID']))
{
die('Invalid name proved, the name may only contain a-z, A-Z,
0-9, "-", "_" and spaces.');
}
else
$empty=strlen($_GET['ID']);
if ($empty==0)
{
die('The text field cannot be empty');
}
else
{
//the input data is clean, retrieve text data input
$ID = $_GET['ID'];
}
$ID = mysql_real_escape_string(stripslashes($ID));
$result_video = $this->db->query("SELECT * FROM td_post WHERE
post_id='$ID'")->result_array();
$direction = $result_video[0]['post_file'];
//close the connection
//change the path to use absolute server path, revised on February
4, 2011
$path= base_url().$direction;
header('Content-type: video/wmv');
//2015236 is the exact file size of the video, change it to
according to your video file size
//header('Content-Length: 2015236');
header("Expires: -1");
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
readfile($path);
}
}
the file doesnt run
when i used this link directly into the browser addressbar, i get a file
to download with no extension, when i change it to my desired extension,
then i can p[lay it on desktop media palyer,
can anybody tell me whats the issue over here??
No comments:
Post a Comment