Playlist video XML Comment créer une en boucle en AS3 ?

gillesvt Messages postés 2 Date d'inscription samedi 22 septembre 2007 Statut Membre Dernière intervention 23 septembre 2010 - 15 sept. 2010 à 16:07
gillesvt Messages postés 2 Date d'inscription samedi 22 septembre 2007 Statut Membre Dernière intervention 23 septembre 2010 - 23 sept. 2010 à 10:28
Bonjour,

J'utilise le code ci-dessous pour lancer une vidéo en flux continu rtmp sur FLash Media Iinterractive Server 3.5.
Ce script fonctionne mais j'aimerai que la Playliste XML reparte au début lorsque la dernière vidéo est finie pour quel ce joue en boucle sans s'arrêter et sans redémarrer l'application ce qui déconnecte le lecteur côté clients, quelqu'un peut-il me dire quel est le code à intégrer, je n'y arrive pas ?

D'avance merci à ceux qui prendront un peu de leur temps pour résoudre mon problème ...

Gilles
34-Hérault, FR


application.allowDebug = true;

//Define events on application start

application.onAppStart = function() {


trace("Application started.");



//Define stream name


this.psuedoStream = Stream.get("clientPlayStream");



//Define playlist variables



var xmlPlaylist = new XML();



xmlPlaylist.ignoreWhite = true;



var resetPlaylist = true;



//Create and read playlist file



fileObj = new File("directtvf.xml");



fileObj.open("UTF8","read");



//Define events on playlist load


xmlPlaylist.onLoad = function(val) {


trace("Playlist loaded.");



//Define video array


var videos = xmlPlaylist.firstChild.childNodes;


trace("Playlist contains "+videos.length+" items...");


//Loop through playlist


for (i = 0; i < videos.length; i++) {


//Define video variables


var videoTitle = videos[i].attributes.title;


var videoURL = videos[i].firstChild.nodeValue;


trace((i+1)+": "+videoTitle+" ("+videoURL+")");


//Play video


if (i == 0) {


application.psuedoStream.play(videoURL, 0, -1, true);


}


else {


application.psuedoStream.play(videoURL, 0, -1, false);


}


}


}


//Load playlist file


xmlPlaylist.load(fileObj);

}


//Prevent termination of application

application.onAppStop = function() {
return true;
}

2 réponses

dialone Messages postés 13 Date d'inscription dimanche 6 septembre 2009 Statut Membre Dernière intervention 26 septembre 2010
22 sept. 2010 à 23:20
pourquoi tout ces éspaces? c'est illisible a force
0
gillesvt Messages postés 2 Date d'inscription samedi 22 septembre 2007 Statut Membre Dernière intervention 23 septembre 2010
23 sept. 2010 à 10:28
Salut,

C'est vrai ... je corrige donc et j'espère que cette fois ça permettra à quelqu'un de m'aider à faire jouer la playkist en boucle sans relancer l'application.... ;-)

Gilles

************************************


application.allowDebug = true;

//Define events on application start
application.onAppStart = function() {
trace("Application started.");

//Define stream name
this.psuedoStream = Stream.get("clientPlayStream");

//Define playlist variables
var xmlPlaylist = new XML();
xmlPlaylist.ignoreWhite = true;
var resetPlaylist = true;

//Create and read playlist file
fileObj = new File("directtvf.xml");
fileObj.open("UTF8","read");

//Define events on playlist load
xmlPlaylist.onLoad = function(val) {
trace("Playlist loaded.");

//Define video array
var videos = xmlPlaylist.firstChild.childNodes;
trace("Playlist contains "+videos.length+" items...");

//Loop through playlist
for (i = 0; i < videos.length; i++) {

//Define video variables
var videoTitle = videos[i].attributes.title;
var videoURL = videos[i].firstChild.nodeValue;
trace((i+1)+": "+videoTitle+" ("+videoURL+")");


//Play video
if (i == 0) {
application.psuedoStream.play(videoURL, 0, -1, true);
}
else {
application.psuedoStream.play(videoURL, 0, -1, false);
}
}
}

//Load playlist file
xmlPlaylist.load(fileObj);
}

//Prevent termination of application
application.onAppStop = function() {
return true;
}
0
Rejoignez-nous