surfingtonio Posted January 5, 2008 Share Posted January 5, 2008 im trying to serve .wma files through php. the code i have is this: session_start(); function createASXMarkup ($mediaURL, $media) { $source = '<asx version="3.0">'."\n"; $source .= '<entry>'."\n"; $source .= '<title>title goes here..</title>'."\n"; $source .= '<ref href="'.$mediaURL.$media.'" />'."\n"; $source .= '<author>Authoer</author>'."\n"; $source .= '<copyright>©2008 example.com</copyright>'."\n"; $source .= '</entry>'."\n"; $source .= '</asx>'."\n"; return $source; } if ($_SESSION['logged']) { $mediaURL = 'http://example.com/'; header('content-disposition: filename='.$_REQUEST['video']); header('content-type: video/x-ms-asf;'); echo createASXMarkup ($mediaURL, $_REQUEST['video']); } else { header ('location:login.php?video='.$_REQUEST['video']); } it properly redirects when user is not logged but it only gives a black media player window on firefox when the user is logged in. if i remove the conditional checks: function createASXMarkup ($mediaURL, $media) { $source = '<asx version="3.0">'."\n"; $source .= '<entry>'."\n"; $source .= '<title>title goes here..</title>'."\n"; $source .= '<ref href="'.$mediaURL.$media.'" />'."\n"; $source .= '<author>Authoer</author>'."\n"; $source .= '<copyright>©2008 example.com</copyright>'."\n"; $source .= '</entry>'."\n"; $source .= '</asx>'."\n"; return $source; } $mediaURL = 'http://example.com/'; header('content-disposition: filename='.$_REQUEST['video']); header('content-type: video/x-ms-asf;'); echo createASXMarkup ($mediaURL, $_REQUEST['video']); the stream works fine on both firefox and ie. i have no idea what's going on. please help!!! ??? Quote Link to comment https://forums.phpfreaks.com/topic/84608-streaming-asx-files/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.