Hello everyone,
I recently purchased the commercial version of Flowplayer and currently have it configured fine for progressive download of .flv, mp4 videos and .mp3 audio. I would greatly appreciate some help/advice how to configure RTMP streaming with SimpleCDN.
I submitted the following ticket to simpleCDN - I don't know how long it will take for them to respond. I'll post theire reply here for the benefit of others.
Thanks!
Jerry
++++++++++++++++++++++++++++++++++++++++++++
How to configure RTMP streaming with Flowplayer
Hello,
I tried your CDN service this week. I love it and think you have a terrific service that I will recommend to colleages.
It was "simple" and "fast" to set up and integrate with my web applicaton which currently implements progressive
download with Flowplayer.
It took about 10 minutes including creating my account with simpleCDN and modifiying my exisiting JavaScript and
PHP code to point to simpleCDN for videos, etc. instead of my webserver. Naturally, FTPing all of my content
to simpleCDN took a tad more time :>
I have never implemented RTMP streaming (I only recently began to work with video).
MY PROBLEM
I can't figure out how to modify my existing code (for progresive download) to get RTMP streaming to work.
Your help is greatly appreciated.
I am using the latest commercial version of Flowplayer.
HERE'S MY WORKING CODE FOR PROGRESSIVE DOWNLOAD (I changed my webserver's domain to "example")
Please note that I have downloaded the Flowplayer RTMP Streaming Plugin (flowplayer.rtmp-3.1.3.swf) and I placed it
in the same folder as my Flowplayer (flowplayer.commercial-3.1.5.swf). I also have the Flowplayer Audio plugin installed (flowplayer.audio-3.1.2.swf)
PROGRESSIVE DOWNLOADED VIDEO
THE FOLLOWING CODE WORKS FINE TO DISPLAY PROGRESSIVE DOWNLOADED VIDEOS(.flv, .mp4 and .mp3).
//PHP Page that renders html and video to browser
function playVideo(myVideoUrl) {
flowplayer("player", {src: 'http://e1.simplecdn.net/exampleuploadbucket/video/flowplayer.commercial-3.1.5.swf', wmode: 'opaque'}, {
key: 'examplekey#',
clip: {
autoPlay: true,
autoBuffering: true,
baseUrl: 'http://www.example.com/pages/',
//to cloak the url/folder where videos are located we pass the videoID to a PHP page
//to return the complete URL to Flowplayer
url: escape('play.php?vid=' + myVideoUrl),
scaling: 'scale',
}
},
plugins:{
controls:{
autoHide: 'always'
}
},
}
);
}
/http://www.example.com/pages/play.php
$vid = (isset($_GET['vid']))? $_GET['vid'] : '';
//video urls are stored in an xml and file and the path to the video is retrieved from the xml here
$xml = simplexml_load_file("videos.xml");
$video = $xml->xpath("//*[id='$vid']");
$videourl = http://e1.simplecdn.net/exampleuploadbucket/video" . "{$video[0]->videourl}";
//this shows the exploded url that is returned to Flowplayer
//$videourl = http://e1.simplecdn.net/exampleuploadbucket/video/filename.mp4"; // or filename.flv or filename .mp3
#echo $videourl;
header("Location: $videourl");
?>
RTMP STREAMING VIDEO
THE FOLLOWING CODE LOADS THE FLOWPLAYER BUT MY CONFIGURATION IS WRONG BECAUSE FLOWPLAYER DISPLAYS AN ERROR
THAT IT CAN'T FIND MY SPECIFIED VIDEO FILE.
200, Stream not found, NetStream.Play.StreamNotFound, clip: '[Clip] 'play.php?vid=100'
(where 100 is the correct videoID of my specified video I'm trying to stream)
I have reviwed the sample code on Flowplayer.org and and SimpleCDN.com and I can't figure out how to make this work.
I noticed the following line in the SimpleCDN sample code:
'mp4:sfexamples/videos/bbb_640x360_h264.mp4',
I know I am not following that syntax and is this indicating that I will have to preface each video file path by its
file extension? If so, I will have to change the format that I am storing content URLs and then do some work to
generate the correct prefix for each video's path - I don't understand why simpleCDN or Flowplayer would not do this under
the covers if it really needs to be done. Then again, I'm sure there's a "simple" solution that you folks know :>
Thank you in advance for your help.
//PHP Page that renders html and video to browser
function playVideo(myVideoUrl) {
flowplayer("player", {src: 'http://e1.simplecdn.net/exampleuploadbucket/video/flowplayer.commercial-3.1.5.swf', wmode: 'opaque'}, {
key: 'examplekey#',
clip: {
autoPlay: true,
autoBuffering: true,
baseUrl: 'http://www.example.com/pages/',
//to cloak the url/folder where videos are located we pass the videoID to a PHP page
//to return the complete URL to Flowplayer
url: escape('play.php?vid=' + myVideoUrl),
//for simpleCDN RTMP streming
provider: 'simplecdn',
scaling: 'scale',
}
},
plugins:{
controls:{
autoHide: 'always'
},
//for simpleCDN RTMP streming
simplecdn: {
url: 'http://e1.simplecdn.net/exampleuploadbucket/video/flowplayer.rtmp-3.1.3.swf',
netConnectionUrl: 'rtmpt://e1f1.simplecdn.net/play'
}
},
}
);
}
/http://www.example.com/pages/play.php
$vid = (isset($_GET['vid']))? $_GET['vid'] : '';
//video urls are stored in an xml and file and the path to the video is retrieved from the xml here
$xml = simplexml_load_file("videos.xml");
$video = $xml->xpath("//*[id='$vid']");
//simpleCDN RTMP stream location
$videourl = "rtmp://e1f1.simplecdn.net/play/_definst_/exampleuploadbucket/video" . "{$video[0]->videourl}";
//this shows the exploded url that is returned to Flowplayer
//$videourl = http://e1.simplecdn.net/exampleuploadbucket/video/filename.mp4"; // or filename.flv or filename .mp3";
#echo $videourl;
header("Location: $videourl");
?>
Cheers!
Jerry Bruckner
I recently purchased the commercial version of Flowplayer and currently have it configured fine for progressive download of .flv, mp4 videos and .mp3 audio. I would greatly appreciate some help/advice how to configure RTMP streaming with SimpleCDN.
I submitted the following ticket to simpleCDN - I don't know how long it will take for them to respond. I'll post theire reply here for the benefit of others.
Thanks!
Jerry
++++++++++++++++++++++++++++++++++++++++++++
How to configure RTMP streaming with Flowplayer
Hello,
I tried your CDN service this week. I love it and think you have a terrific service that I will recommend to colleages.
It was "simple" and "fast" to set up and integrate with my web applicaton which currently implements progressive
download with Flowplayer.
It took about 10 minutes including creating my account with simpleCDN and modifiying my exisiting JavaScript and
PHP code to point to simpleCDN for videos, etc. instead of my webserver. Naturally, FTPing all of my content
to simpleCDN took a tad more time :>
I have never implemented RTMP streaming (I only recently began to work with video).
MY PROBLEM
I can't figure out how to modify my existing code (for progresive download) to get RTMP streaming to work.
Your help is greatly appreciated.
I am using the latest commercial version of Flowplayer.
HERE'S MY WORKING CODE FOR PROGRESSIVE DOWNLOAD (I changed my webserver's domain to "example")
Please note that I have downloaded the Flowplayer RTMP Streaming Plugin (flowplayer.rtmp-3.1.3.swf) and I placed it
in the same folder as my Flowplayer (flowplayer.commercial-3.1.5.swf). I also have the Flowplayer Audio plugin installed (flowplayer.audio-3.1.2.swf)
PROGRESSIVE DOWNLOADED VIDEO
THE FOLLOWING CODE WORKS FINE TO DISPLAY PROGRESSIVE DOWNLOADED VIDEOS(.flv, .mp4 and .mp3).
//PHP Page that renders html and video to browser
function playVideo(myVideoUrl) {
flowplayer("player", {src: 'http://e1.simplecdn.net/exampleuploadbucket/video/flowplayer.commercial-3.1.5.swf', wmode: 'opaque'}, {
key: 'examplekey#',
clip: {
autoPlay: true,
autoBuffering: true,
baseUrl: 'http://www.example.com/pages/',
//to cloak the url/folder where videos are located we pass the videoID to a PHP page
//to return the complete URL to Flowplayer
url: escape('play.php?vid=' + myVideoUrl),
scaling: 'scale',
}
},
plugins:{
controls:{
autoHide: 'always'
}
},
}
);
}
/http://www.example.com/pages/play.php
$vid = (isset($_GET['vid']))? $_GET['vid'] : '';
//video urls are stored in an xml and file and the path to the video is retrieved from the xml here
$xml = simplexml_load_file("videos.xml");
$video = $xml->xpath("//*[id='$vid']");
$videourl = http://e1.simplecdn.net/exampleuploadbucket/video" . "{$video[0]->videourl}";
//this shows the exploded url that is returned to Flowplayer
//$videourl = http://e1.simplecdn.net/exampleuploadbucket/video/filename.mp4"; // or filename.flv or filename .mp3
#echo $videourl;
header("Location: $videourl");
?>
RTMP STREAMING VIDEO
THE FOLLOWING CODE LOADS THE FLOWPLAYER BUT MY CONFIGURATION IS WRONG BECAUSE FLOWPLAYER DISPLAYS AN ERROR
THAT IT CAN'T FIND MY SPECIFIED VIDEO FILE.
200, Stream not found, NetStream.Play.StreamNotFound, clip: '[Clip] 'play.php?vid=100'
(where 100 is the correct videoID of my specified video I'm trying to stream)
I have reviwed the sample code on Flowplayer.org and and SimpleCDN.com and I can't figure out how to make this work.
I noticed the following line in the SimpleCDN sample code:
'mp4:sfexamples/videos/bbb_640x360_h264.mp4',
I know I am not following that syntax and is this indicating that I will have to preface each video file path by its
file extension? If so, I will have to change the format that I am storing content URLs and then do some work to
generate the correct prefix for each video's path - I don't understand why simpleCDN or Flowplayer would not do this under
the covers if it really needs to be done. Then again, I'm sure there's a "simple" solution that you folks know :>
Thank you in advance for your help.
//PHP Page that renders html and video to browser
function playVideo(myVideoUrl) {
flowplayer("player", {src: 'http://e1.simplecdn.net/exampleuploadbucket/video/flowplayer.commercial-3.1.5.swf', wmode: 'opaque'}, {
key: 'examplekey#',
clip: {
autoPlay: true,
autoBuffering: true,
baseUrl: 'http://www.example.com/pages/',
//to cloak the url/folder where videos are located we pass the videoID to a PHP page
//to return the complete URL to Flowplayer
url: escape('play.php?vid=' + myVideoUrl),
//for simpleCDN RTMP streming
provider: 'simplecdn',
scaling: 'scale',
}
},
plugins:{
controls:{
autoHide: 'always'
},
//for simpleCDN RTMP streming
simplecdn: {
url: 'http://e1.simplecdn.net/exampleuploadbucket/video/flowplayer.rtmp-3.1.3.swf',
netConnectionUrl: 'rtmpt://e1f1.simplecdn.net/play'
}
},
}
);
}
/http://www.example.com/pages/play.php
$vid = (isset($_GET['vid']))? $_GET['vid'] : '';
//video urls are stored in an xml and file and the path to the video is retrieved from the xml here
$xml = simplexml_load_file("videos.xml");
$video = $xml->xpath("//*[id='$vid']");
//simpleCDN RTMP stream location
$videourl = "rtmp://e1f1.simplecdn.net/play/_definst_/exampleuploadbucket/video" . "{$video[0]->videourl}";
//this shows the exploded url that is returned to Flowplayer
//$videourl = http://e1.simplecdn.net/exampleuploadbucket/video/filename.mp4"; // or filename.flv or filename .mp3";
#echo $videourl;
header("Location: $videourl");
?>
Cheers!
Jerry Bruckner