Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

External Config and Streaming Script

18 replies [Last post]

Not sure if this is a bug or if I have simply mistyped something.

For what it is is worth I use Lighty and the flv mod for streaming. (streamscript = lighttpd)

I am using: www.simplethoughtproductions.com/video_config.xml

Player code is:

<p id="Beartooth_Pass"><a href="http://www.macromedia.com/go/getflashplayer">Get the Flash Player</a> to see this player.</p>
<script type="text/javascript">
var s2 = new SWFObject("/flvplayer.swf","playlist","480","295","7");
s2.addParam("allowfullscreen","true");
s2.addVariable("file","/wp-content/uploads/SimpleShorts/Beartooth_Pass.flv");
s2.addVariable("config","/video_config.xml");
s2.addVariable("height","280");
s2.addVariable("width", "480");
s2.addVariable("title", "Beartooth Pass");
s2.addVariable("showdownload", "true");
s2.addVariable("link", "/wp-content/uploads/SimpleShorts/Beartooth_Pass.wmv");
s2.write("Beartooth_Pass");
</script>

Streams fine when its in the player code but it will not stream when its in the config.xml any tips?

Still having the issue... do I need to provide more info? Thanks for your time.

You should always validate your XML files like config.xml, by loading them into a validating XML editor or loading them into your browser with this URI: http://www.simplethoughtproductions.com/video_config.xml

You might see this error:

XML Parsing Error: mismatched tag. Expected: </searchlink>.
Location: http://www.simplethoughtproductions.com/video_config.xml
Line Number 4, Column 59: <searchlink>http://www.simplethoughtproductions.com/?s=</seachlink>
-----------------------------------------------------------------^

There is also an error in this element that would be caught by a validating XML editor:<shuffle>false</<strong>repeat</strong>>

And the special characters ( ? = & ) in all URLs must be URLencoded:<searchlink>http://www.simplethoughtproductions.com/%3Fs%3D</searchlink>

XML Parsing Error: mismatched tag. Expected: </searchlink>.
Location: http://www.simplethoughtproductions.com/video_config.xml
Line Number 4, Column 59: <searchlink>http://www.simplethoughtproductions.com/?s=</sea<strong>r</strong>chlink>
--------------------------------------------------------------------------------------^

check the spelling

Figures, could have swore I copy and pasted so bolth should be off. Oddly enough the search was working but Ill change it to the proper URL encoded method. It does have issues in that the player passes multiple words with spaces when the search I have needs + between words.

Try encoding the plus signs with %252B.

That's a double-encoded plus sign. Once for the plus sign to %2B, twice for the percent sign to %252B

i am streaming fine when i use player.swf directly but when i load through loader ...it is streaming but black display.
<config>
<logo></logo>
<skin></skin>
<playlist>none</playlist>
<repeat>true</repeat>
<stretching>uniform</stretching>
<volume>50</volume>
<quality>true</quality>
<autostart>false</autostart>
<width>320</width>
<height>280</height>
<linktarget>none</linktarget>
<type>video</type>
<streamer>http://localhost:81/media/flvprovider.php</streamer>
<file>teaser3.flv</file>
</config>

any idea?.

It was my mistake. I need to create keyframe then add my load script...it is working now..only issue is control the width and height. at present it occupying 100% loader area.

hi every one,

Where can I find a classic asp script to steamong like XMOOV?

pleas answer me... thank's

streaming * sorry

 
@Naor,

See this post: http://www.jeroenwijering.com/?thread=6080#msg35655

There may be others. Use Search this Site for "stream asp".

yes thanks I've tried this script but still I can't play the flv file
maybe I don't config the player code right

playMovie.asp

<script type='text/javascript' src='mediaplayer/swfobject.js'></script>
<p id='example' class="media">Here the video will be shown.</p>

<script type='text/javascript'>
var s1 = new SWFObject('mediaplayer/player.swf','ply','420','250','9','#ffffff');
s1.addParam('allowfullscreen','true');
s1.addParam('flashvars','file=17323.flv&streamer=stream.asp');
s1.write('example');
</script>

i try to stream the 17323.flv file
is this should look like this???

@Naor,

Did you change "pos" to "start" for the v4.x player?

v3.xvalPos = Request("pos")
v4.xvalPos = Request("<strong>start</strong>")

WOW thank you very much It's working

but it work's just in IE
how can I fix it for firefox?

thank you...

The same player code should work for FF.

What error message are you getting?

Is the FF Flash Player version 9 something?

thank's kLink for you'r help,

No error message, just did not run the video forward and not broadcast it well.
The player is JW FLV MEDIA PLAYER 4.2

Something bad happened, I ran the script on the server and the server crush, and until now I can not fix it
maybe there is a loop who don't stop.

I have a Error message in my all websites - "HTTP/1.1 Server Too Busy" - Very weird

this is the script file - stream.asp

<%
response.Buffer = true
Response.ContentType = "video/x-flv"
'request position and file name
Dim valPos,valFile
valPos = Request("start")
valFile = Server.Mappath(Request("file"))

'check whether file type is FLV
If (LCase(Right(valFile,Len(valFile)-InstrRev(valFile,"."))) <> "flv")Then
Response.End
End if
'if position was not passed set pos to 0
If (valPos = "") Then
valPos = 0
End if
'create streaming object
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = 1
objStream.LoadFromFile(valFile)

'if pos is greate than 0 proceed to get FLV header information
If (valPos > 0) Then
Response.BinaryWrite objStream.Read(13)
End if

'set position to begin streaming
objStream.Position = valPos
'loop through file, flush and clear buffer each time
do while Not objStream.EOS
Response.BinaryWrite objStream.Read (163840)
Response.Flush
Response.Clear
loop
'close stream object
objStream.Close
Set objStream = Nothing
%>

maybe I do something wrong :(

thank you

I'm not familiar with ASP, but the code looks OK.

Have you tried calling the streaming script from your browser to see if there are any error messages output from the script.

       http://my.domain.com/path/stream.asp?start=12345&file=17323.flv

You could also use GNU Wget to call the stream to see what the full set of headers is.

       wget -S "http://my.domain.com/path/stream.asp?start=12345&file=17323.flv"

hey i need help please....

i put this code in my flash file.....

Stage.scaleMode = "noScale";
Stage.align = "TL";

import mx.transitions.Tween;
import mx.transitions.easing.*;

//resize function
function toggleFullScreen(){
if(Stage["displayState"]=="normal"){
Stage["displayState"]="fullScreen";
}else{
Stage["displayState"]="normal";
}
}

fsBt.onRelease = function(){
toggleFullScreen();
if(this._currentframe == 10) {
this.gotoAndStop(30);
}
else {
this.gotoAndStop(10);
}
}
fsBt.onRollOver = function() {
if(this._currentframe == 1) {
this.gotoAndStop(10);
}
else {
this.gotoAndStop(30);
}
}

fsBt.onRollOut = function() {
if(this._currentframe == 10) {
this.gotoAndStop(1);
}
else {
this.gotoAndStop(20);
}
}

function resizeHandler(){
if(Stage["displayState"]=="normal"){
fsBt.gotoAndStop(1);
}

video._height = Stage.height - 37;
video._width = Stage.width;
previousBt._y = Stage.height - 12;
nextBt._y = Stage.height - 12;
playPause._y = Stage.height-18;
barBg._y = Stage.height-37;
barBg._width = Stage.width;
timecode._y = Stage.height - 37;
//timecode._x = Stage.width - timecode._width -108;
loadbar.theBar._width = Stage.width - 190;
loadbar._y = Stage.height - 22;
progressBar.theBar._width = Stage.width - 190;
progressBar._y = Stage.height - 22;
muteBt._y = Stage.height - 30;
muteBt._x = Stage.width - 106;
volScrub._y = Stage.height - 22;
volScrub._x = Stage.width - 83;
volBottom._y = Stage.height - 22;
volBottom._x = Stage.width - 83;
fsBt._y = Stage.height - 26;
fsBt._x = Stage.width - 22;
}
resizeHandler();
var stageResize:Object = new Object();
stageResize.onResize = function(){
resizeHandler();
}
Stage.addListener(stageResize);

//video player
var nc:NetConnection = new NetConnection();
nc.connect(null);

var ns:NetStream = new NetStream(nc);
var whoIsOn:Number = 0; //which video is playing
var myVideo:Array = new Array;

ns.onStatus = function(info) {
if(info.code == "NetStream.Play.Start") {
progressBar.onEnterFrame = videoUpdate;
}
if(info.code == "NetStream.Play.Stop") { //when at the end of a video
whoIsOn++;
if (whoIsOn>=videos.length) { //you are on the last video
whoIsOn=0; //go back to 1st video
}
ns.play(myVideo[whoIsOn]);
}
}
var myDuration:String; //NOT Number

ns.onMetaData = function(info) {
ns.duration = info.duration;
myDuration = getTimecode(ns.duration);
}

video.attachVideo(ns);

//audio controls
this.createEmptyMovieClip("vidSound",2);
vidSound.attachAudio(ns);
var vSound:Sound = new Sound(vidSound);
vSound.setVolume(75);
volScrub._xscale = 75;

volBottom.onPress = function() {
adjustSound();
this.onMouseMove = adjustSound;
muteBt.gotoAndStop(1);
}

volBottom.onRelease = volBottom.onReleaseOutside = function() {
delete this.onMouseMove;
}

function adjustSound() {
var dist:Number = Math.floor(((_xmouse-volBottom._x)/volBottom._width)*100);
if(dist >= 0 && dist <= 100) {
volScrub._xscale = dist;
vSound.setVolume(dist);
}
}

function adjustSound2() {
vSound.setVolume(volScrub._xscale);
}

//the buttons
muteBt.onRollOver = function() {
if(this._currentframe == 1) {
this.gotoAndStop(10);
}
else {
this.gotoAndStop(30);
}
}

muteBt.onRollOut = function() {
if(this._currentframe == 10) {
this.gotoAndStop(1);
}
else {
this.gotoAndStop(20);
}
}
var volNumber:Number = volScrub._xscale;
muteBt.onRelease = function() {
if(this._currentframe == 10) {
this.gotoAndStop(30);
volNumber = volScrub._xscale;
var myTween:Object = new Tween(volScrub,"_xscale", None.easeIn,volScrub._xscale,0,1,true);
_root.onEnterFrame = adjustSound2;
myTween.onMotionFinished = function(){
adjustSound2();
delete _root.onEnterFrame;
}
}
else {
this.gotoAndStop(10);
var myTween:Object = new Tween(volScrub,"_xscale", None.easeIn,volScrub._xscale,volNumber,1,true);
_root.onEnterFrame = adjustSound2;
myTween.onMotionFinished = function(){
adjustSound2()
delete _root.onEnterFrame;
}
}
}

previousBt.onRelease = function() {
whoIsOn--;
if (whoIsOn == -1) {
whoIsOn = videos.length-1; //go back to 1st video
}
ns.play(myVideo[whoIsOn]);
}
nextBt.onRelease = function(){
whoIsOn++;
if (whoIsOn>=videos.length) { //you are on the last video
whoIsOn=0; //go back to 1st video
}
ns.play(myVideo[whoIsOn]);
}

playPause.onRollOver = function() {
if(this._currentframe == 1) {
this.gotoAndStop("pauseOver");
}
else {
this.gotoAndStop("playOver");
}
}

playPause.onRollOut = function() {
if(this._currentframe == 10) {
this.gotoAndStop("pause");
}
else {
this.gotoAndStop("play");
}
}

playPause.onRelease = function() {
if(this._currentframe == 10) {
this.gotoAndStop("playOver");
ns.pause(true);
}
else {
this.gotoAndStop("pauseOver");
ns.pause(false);
}
}

//loadbar
loadbar.onEnterFrame = function() {
this._xscale = (ns.bytesLoaded/ns.bytesTotal)*100;
}

//update video
function videoUpdate() {
progressBar._xscale = (ns.time/ns.duration)*100;
timecode.text = getTimecode(ns.time) + " / " + myDuration;
}

//video scrub
loadbar.onPress = function() {
progressBar.onEnterFrame = videoScrub;
}

loadbar.onRelease = loadbar.onReleaseOutside = function() {
progressBar.onEnterFrame = videoUpdate;
}

function videoScrub() {
var dist:Number = (_xmouse-loadbar._x)/loadbar._width;
ns.seek(Math.floor(ns.duration*dist));
progressBar._xscale = (ns.time/ns.duration)*100;
timecode.text = getTimecode(ns.time) + " / " + myDuration;
}

//time code
function getTimecode(theTime) {
var t:Number = Math.round(theTime);
var min:Number = Math.floor(t/60);
var sec:Number = t%60;
var s:String = "";
if(min < 10) {
s += "0";
}
if(min >= 1) {
s += min.toString();
}
else {
s += "0";
}
s += ":";
if(sec < 10) {
s += "0";
s += sec.toString();
}
else {
s += sec.toString();
}
return s;
}

//load the XML
var vlist:XML = new XML();
vlist.ignoreWhite = true;
var videos:Array = new Array;
vlist.onLoad = function() {
videos = vlist.firstChild.childNodes;
for(i=0;i<videos.length;i++) {
myVideo.push(videos[i].attributes.url);
}

ns.play(myVideo[whoIsOn]);
}

vlist.load("config.xml");

//use this if you want your XML list to be loaded every time your enter this flash app (so it will not be loaded from the cache folder)
//vlist.load("videos.xml?cachebuster=" + new Date().getTime());

i put this code in my xml file.

<xml version="1.0" encoding="ISO-8859-1">

<video>

<link www.mydomain.com="/videos/corp.flv"/>

</video>

i am unable to get it play on my website....

need help guys.....

 
This Forum is mostly for support of the JW FLV Player.

You might find much better Flash support on other forums.