3 Replies - 2020 Views - Last Post: 12 August 2008 - 12:42 PM

#1 SecondSight  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 04-August 08

XML video playlist not working on the web

Posted 04 August 2008 - 12:51 AM

Hello ! :)

I'm a school teacher and I've made a video player which displays guitar video lessons for my pupils. It's made with the Flash video component for flv, AS2 and XML and the videos are published on a Flash media server (streaming server).

I first published the videos on my pupils' web site using html pages + the video component and it's working well.

Then I tried to make a flash video player, but it's not working as expected, and I can't find out why :
- only the first video of the video lists is played and if I try playing another, it freezes the animation.
- if I change which video is played first (if I change the code so that it plays the second or the third video first in a list, for instance), it will play the video. So I believe both the XML files and the video files are ok.
- I checked the data in the combo and saw it's ok too.
- The menus are displaying correctly.

In fact, everything is ok, until I cilck on the listbox to read another video.

So, in the end, I don't know what's wrong... Can someone help me ?

You can see the video player here :
http://guitare.bellepierre.info/flash/
(please note that the videos are not professional videos, it's just for my pupils to work at home).

I publish all the code below. Can someone tell me what is wrong with the listbox's code ?
There's a listener for the listbox and the listener is calling a function to play the video and this is what is not working. If I replace the videoPlay function with something like :
videoPlayer.play(file_url)
it won't work...
If I do the same elsewhere, it works. So I wonder if there is a problem of scope...

But in the videoPlay function, part of the code is executed :

function playVideo(){
videoPlayer.play(videoList_lst.getItemAt(n).data); => this one is not working when I click on the list box (but it does work in other functions). Why ?
videoList_lst.selectedIndex=n;
titre_txt.text=videos[n].attributes.titre; => this one is working !
}



Thank you for your help ! :)

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
	/*videos_cb is the combobox which displays the video categories.
	videoList_lst is the listbox which displays the list of all the videos.
	videoPlayer is the video component's name.
	titre_txt is a text box displaying the video's title.*/

	stop();

	var videos:Array
	var categorie:String = "musiques.xml";
	videos_cb.selectedIndex=4;
	var vList:XML = new XML();
	vList.ignoreWhite = true;
	var n:Number=0;

	vList.load(categorie);

	vList.onload = function(){
	   videos = this.firstChild.childNodes;
	   for(i=0;i<videos.length;i++){
		  videoList_lst.addItem(videos[i].attributes.desc,videos[i].attributes.chemin,videos[i].attributes.titre);
	   }
	   playVideo();
	}


	function playVideo(){
	   videoPlayer.play(videoList_lst.getItemAt(n).data);
	   videoList_lst.selectedIndex=n;
	   titre_txt.text=videos[n].attributes.titre;
	}

	// COMBOBOX
	var comboListnr:Object = new Object();
	comboListnr.change = function() {
	   videoPlayer.stop();
	   categorie=videos_cb.value;
	   videoList_lst.removeAll();
	   vList.load(categorie);
	}
	videos_cb.addEventListener("change",comboListnr);

	// LISTBOX
	var listListnr:Object = new Object();
	listListnr.change = function() {
	   videoPlayer.stop();
	   n=videoList_lst.selectedIndex;
	   playVideo();
	}
	videoList_lst.addEventListener("change",listListnr);


This post has been edited by SecondSight: 04 August 2008 - 01:51 AM


Is This A Good Question/Topic? 0
  • +

Replies To: XML video playlist not working on the web

#2 SecondSight  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 04-August 08

Re: XML video playlist not working on the web

Posted 06 August 2008 - 10:52 AM

Hello ! :)

I've made a few more tests. I've tested it with a simple button too, using this code :

testbutton.onRelease=function(){
//playVideo(); [b]=> Using the function = not working[/b]
videoPlayer.play('rtmp://mystreamingsername.org/guitare/noelblanc.flv'); [b]=> Not working too ![/b]
titre_txt.text=videos[n].attributes.titre; [b]=> This one is working[/b]
}


So, it appears that even with a button, I can't have the player reading files...

But :

- the videos are being played at the beginning, when I launch the application, with this code :

vList.onload = function(){
	   videos = this.firstChild.childNodes;
	   for(i=0;i<videos.length;i++){
		  videoList_lst.addItem(videos[i].attributes.desc,videos[i].attributes.chemin,videos[i].attributes.titre);
	   }
	   playVideo();
	}

function playVideo(){
	   videoPlayer.play(videoList_lst.getItemAt(n).data);
	   videoList_lst.selectedIndex=n;
	   titre_txt.text=videos[n].attributes.titre;
	}


- It also works if I use the playVideo function's code outside of the function. For instance if I write somewhere :
videoPlayer.play('rtmp://mystreamingsername.org/guitare/noelblanc.flv');
It will play the video.

- It also works if I write playVideo(); outide of the other functions.


What can I conclude from that ?


It seems like using a button or the video list component makes it impossible to reach the streaming server.
But using code outside of components and buttons does work.

Can you explain to me how I can solve this problem ?

Thank you ! :)

This post has been edited by SecondSight: 06 August 2008 - 10:55 AM

Was This Post Helpful? 0
  • +
  • -

#3 bmcc81  Icon User is offline

  • D.I.C Regular

Reputation: 2
  • View blog
  • Posts: 312
  • Joined: 10-July 07

Re: XML video playlist not working on the web

Posted 12 August 2008 - 12:25 PM

Try checking out

Tutorial - Video XML - Lee Brimlow

Very good Tutorial!!!

Hope it helps
Was This Post Helpful? 0
  • +
  • -

#4 SecondSight  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 4
  • Joined: 04-August 08

Re: XML video playlist not working on the web

Posted 12 August 2008 - 12:42 PM

Yes, I know this tutorial, but Lee Brimelow is not using the FLVplayback component.

It seems like this component does not work well with a streaming server when there are many files. I've read on a web site that it looses mapping when there are several files to be played. Or perhaps I simply don't know how to make it work with a streaming server.

Each time I click on the component list to play another video, I get an error message saying that it can't access the server.

Anyway, I managed to make a video player, without using the FLVplayback component. Here it is :
http://guitare.bellepierre.info

It's for my 9 years old pupils, to learn guitar. :)
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1