Xml playlist livestream
Hi all
I have created an xml playlist to play a live stream first, and I have a 2nd playlist item, which is an on demand video, which I want to start playing should the live stream dropout.
At the moment if the livestream stops the player just tries to rebuffer it and won't move onto the 2nd playlist item. Does anyone know how I can get the playlist to start playing the on demand video?
The idea is to provide some back up so if there is a problem the viewer still gets some content. Ideally I would want to loop the playlist some how so that after the second playlist item finishes the livestream is tried again.
Any help with this would be greatly appreciated.
Thanks
Hi I dont know what exactly you mean by XML Playlist.But let me try to give simple example which might help you. Say you are playing a live stream and suddenly the live stream stops so you want to switch to on-demand video. This is very simple to achieve - What you have to do is define NetStream.onStatus handler and track various status messages in order to perform certain actions. In this case when liveStream stops, client should get "NetStream.Play.UnPublishNotify" indicating that live stream has stopped so it can issue play for on-demand video. When on-demand video is stopped, you can reissue play for live stream. But its better you also use NetStream.time property to check if its increasing to be sure that live stream is indeed playing - because when you issue play for live stream and there is none getting published at server , you will get NetStream.Play.Start and it will continue to wait for someone to publish stream by that name on the server. Hope this answers your question - do let me know if you have any more queries.
Similar Messages
-
Running a live stream from an XML playlist
I have just successfully installed Adobe FMS on my server.
I would now like to know how to program a script to run a continuous live stream, of MP4 videos, from an XML playlist.
Can anyone tell me how to do this? ...or provide me a good tutorial? (I am a complete newbie to ActionScript.)
Thanks in advance...application.allowDebug = true;
application.onAppStart = function(){
this.userID =0;
this.playObj = new Object();
this.timObj = new Object();
this.passCli = new Object();
this.couObj = new Object();
this.couObj.count = 1;
application.so0 = SharedObject.get("so",false);
this.dates = new Object;
this.dates.dat0 = new Date().valueOf()+"a";
this.dates.dat1 = new Date().valueOf()+"b";
this.dates.dat2 = new Date().valueOf()+"c";
this.dates.dat3 = new Date().valueOf()+"d";
this.myStream = new Object;
this.myStream.st = Stream.get (this.dates.dat0.toString());
this.myStream.st1 = Stream.get (this.dates.dat1.toString());
this.myStream.st2 = Stream.get (this.dates.dat2.toString());
this.myStream.st3 = Stream.get (this.dates.dat3.toString());
this.int0
this.int1
this.int2
this.int3
this.int4
this.lock0=0;
this.lock1=0;
this.lock2=0;
this.lock3=0;
this.lock4=0;
listen();
function listen(){
clearInterval(application.int3);
application.int0 = setInterval(time,1000,application.myStream.st);
application.myStream.st.onStatus = function(info){
if(info.code == "NetStream.Play.Stop"&&application.lock0==0){
trace("code0"+info.code);
clearInterval(application.int0);
application.timObj.tim = 0;
application.int1 = setInterval(time,1000,application.myStream.st1);
application.couObj.count = 2;
playcurr(application.passCli.cli);
switchStream(application.so0);
listen1(application.myStream.st1);
application.lock0=1;
function listen1(mystreamst1){
mystreamst1.onStatus = function(info){
if(info.code == "NetStream.Play.Stop"&&application.lock1==0){
trace("code1"+info.code);
mystreamst1 = null;
clearInterval(application.int1);
application.timObj.tim = 0;
application.int2 = setInterval(time,1000,application.myStream.st2);
application.couObj.count = 3;
playcurr(application.passCli.cli);
switchStream(application.so0);
listen2(application.myStream.st2);
application.lock1=1
function listen2 (mystream2){
mystream2.onStatus = function(info){
trace("code2"+info.code);
if(info.code == "NetStream.Play.Stop"&&application.lock2==0){
clearInterval(application.int2);
application.mystream2 = null;
application.timObj.tim = 0;
//application.int3 = setInterval(time,1000,application.myStream.st3);
application.couObj.count = 4;
playcurr(application.passCli.cli);
switchStream(application.so0);
application.lock2=1;
listen3(application.myStream.st3);
function listen3(mystream3){
mystream3.onStatus = function(info){
trace("code3"+info.code);
if(info.code == "NetStream.Play.Stop"&&application.lock3==0){
trace("yes yes yes yes yes yes");
clearInterval(application.int3);
application.couObj.count = 1;
mystream3 = null;
application.timObj.tim = 0;
//application.int4 = setInterval(time,1000,application.myStream.st);
playcurr(application.passCli.cli);
switchStream(application.so0);
application.lock0=0;
application.lock1=0;
application.lock2=0;
application.lock3=0;
application.dates.dat0 = new Date().valueOf()+"e";
application.dates.dat1 = new Date().valueOf()+"f";
application.dates.dat2 = new Date().valueOf()+"g";
application.dates.dat3 = new Date().valueOf()+"h";
application.myStream.st = Stream.get (application.dates.dat0.toString());
application.myStream.st1 = Stream.get (application.dates.dat1.toString());
application.myStream.st2 = Stream.get (application.dates.dat2.toString());
application.myStream.st3 = Stream.get (application.dates.dat3.toString());
application.myStream.st.play(application.playObj.vid[0],0,-1,0);
application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
listen();
///here next
application.onConnect = function(client){
application.acceptConnection(client);
application.passCli.cli = client;
client.call("setUserID",null,this.userID);
this.userID++;
if(application.clients.length == 1 ){
videoArray = new Array();
var playlist = new XML();
playlist.ignoreWhite = true;
//parse xml play list for individual elements
playlist.onLoad = function( success ) {
if(playlist.loaded == true) {
if (playlist.firstChild.hasChildNodes()) {
for (var aNode = playlist.firstChild.firstChild; aNode != null; aNode=aNode.nextSibling) {
if (aNode.nodeType == 1) {
//create array from parsed xml elements.
videoArray[aNode.attributes.id] = aNode.attributes.name ;
//pass array out of onload function
application.playObj.vid = videoArray;
application.myStream.st.play(application.playObj.vid[0],0,-1,0);
application.myStream.st1.play(application.playObj.vid[1],0,-1,0);
application.myStream.st2.play(application.playObj.vid[2],0,-1,0);
application.myStream.st3.play(application.playObj.vid[3],0,-1,0);
pass0(videoArray);
//play first video on playlist
playlist.load("http://www.privatechatnow.com/fmsuser/playlist.xml");
}//end onetime if statement
function pass0(videoArray){
//receive array
//play intial video
if(application.clients.length == 1){
// application.playObj.vid=videoArray;
playcurr(application.passCli.cli);
for (var key in application.playObj){
trace(key + ": " + application.playObj[key]);
//put currently playing videio into object
//isolate playlist switching loop for each connected client
//listen to currently playing stream with onStatus
//change to next video in playlist
//use onStatus and current duration and seek to scrub to cuurently playin video each time a user connects.
//continue untill playlist is played then loop back to first video in playlist.
//onConnect play currently playing video
if (application.clients.length >1){
playcurr(application.passCli.cli);
//message client with currently play flv
//message client when flv changes
//message client with metadata
application.onPublish = function(clientObject, streamObject){
trace("Stream name :: "+streamObject.name);
function switchStream(so0){
if(application.couObj.count == 1){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[0].length;
nextlen = application.playObj.vid[1].length;
so0.send("playSecond",application.playObj.vid[0],clength,currlen,nextlen);
if(application.couObj.count == 2){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[1].length;
nextlen = application.playObj.vid[2].length;
so0.send("playSecond",application.playObj.vid[1],clength,currlen,nextlen);
if(application.couObj.count == 3){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[2].length;
nextlen = application.playObj.vid[3].length;
so0.send("playSecond",application.playObj.vid[2],clength,currlen,nextlen);
if(application.couObj.count == 4){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[3].length;
nextlen = application.playObj.vid[0].length;
so0.send("playSecond",application.playObj.vid[3],clength,currlen,nextlen);
function playcurr(client){
trace("count = "+application.couObj.count.toString());
if(application.couObj.count ==1){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[0].length;
nextlen = application.playObj.vid[1].length;
client.call("playZero",null,application.playObj.vid[0],clength,currlen,nextlen);
if(application.couObj.count ==2){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[1].length;
nextlen = application.playObj.vid[2].length;
client.call("playZero",null,application.playObj.vid[1],clength,currlen,nextlen);
if(application.couObj.count ==3){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[2].length;
nextlen = application.playObj.vid[3].length;
client.call("playZero",null,application.playObj.vid[2],clength,currlen,nextlen);
if(application.couObj.count ==4){
clength = application.timObj.tim-3;
currlen = application.playObj.vid[3].length;
nextlen = application.playObj.vid[0].length;
client.call("playZero",null,application.playObj.vid[3],clength,currlen,nextlen);
application.onDisconnect = function(oldclient){
if(application.clients.length ==0){
this.userID--;
function time(myStream){
application.timObj.tim = myStream.time; -
Need help embedding a mp3 player swf with xml playlist
Im a noob to Flash (started tuesday, haha) and so far everything is coming along just fine, but i need to put music in the swf. I have a button set up that slides a swf mp3 player in from the side but i dont know how to make the playlist work with it.
The player is from this site:
http://www.bezzmedia.com/swfspot/samples/flash8/Mp3_Player_with_XML_Playlist
Using the xml playlist with html is simple enough, but im not sure how to use it with Flash Catalyst. Is there an easy way to do this?
My original plan was to have a text list of the songs with a play button next to each one, then when you click on the play button it would set the state of any other songs to Stopped so you can just pick what song to play and if another song was playing it would stop. Im not sure how to do this either (like i said, i started learning this week), so i just tried embedding someone else's (ugly) mp3 player.
Anyway, if anyone knows a relatively easy way to have a playlist in my swf please let me know. Thanks!If I understand you correctly, you've imported a SWF into Catalyst using Import Artwork on the File menu. When your app runs, you want to pass that swf a parameter that tells it what URL to read a data file from. The SWF is not one that you've created, rather, you got it from some web site.
This is not something that you can do in Catalyst. However it should be possible to do in Flash Builder. I found an article discussing several ways to do it, at http://www.actionscript.org/forums/showthread.php3?t=175951. One idea is the following code snippet
<fx:Script>
<![CDATA[
import flash.events.*;
private function setVars(event):void
event.target.content.yyyyyy = "zzzzzz";
]]>
</fx:Script>
<mx:Image source="xxxxx" complete="setVars(event)" />
where "xxxxx" is the path of the SWF (you can put it somewhere in your Flash Builder project, or reference it via an URL), and yyyyy is the name of the parameter that the SWF expects, and zzzzzz is the path to the data file. The <Image> tag is what Catalyst created when you imported the SWF. (btw.the Image and SWFLoader tags are almost identical).
I hope this gives you enough info to make progress. -
I created a custom flv player and loaded a xml playlist. I
would like to the play the videos randomly. could anyone help me
with my script.
the following is my current action script:
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
ns.setBufferTime(30);
ns.onStatus = function(info) {
if(info.code == "NetStream.Buffer.Full") {
bufferClip._visible = false;
if(info.code == "NetStream.Buffer.Empty") {
bufferClip._visible = true;
if(info.code == "NetStream.Buffer.Stop") {
ns.seek(0);
theVideo.attachVideo(ns);
rewindButton.onRelease = function() {
ns.seek(0);
playButton.onRelease = function() {
ns.pause();
var videoInterval = setInterval(videoStatus,100);
var amountLoaded:Number;
var duration:Number;
ns["onMetaData"] = function(obj) {
duration = obj.duration;
function videoStatus(){
amountLoaded = ns.bytesLoaded / ns.bytesTotal;
loader.loadbar._width = amountLoaded * 200;
loader.scrub._x = ns.time / duration * 200;
var scrubInterval;
loader.scrub.onPress = function() {
clearInterval(videoInterval);
scrubInterval = setInterval(scrubit,10);
this.startDrag(false,-5.3,this._y,193.3,this._y);
loader.scrub.onRelease = loader.scrub.onReleaseOutside =
function() {
clearInterval(scrubInterval);
videoInterval = setInterval(videoStatus,100);
this.stopDrag();
function scrubit() {
ns.seek(Match.floor((loader.scrub._x/200)*duration));
var theMenu:ContextMenu = new ContextMenu();
theMenu.hideBuiltInItems();
_root.menu = theMenu;
var i1:ContextMenuItem = new ContextMenuItem("::::
VideoControls ::::",trace);
theMenu.customItems[0] = i1;
var i2:ContextMenuItem = new ContextMenuItem("Play / Pause
Video",pauseIt,true);
theMenu.customItems[1] = i2;
var i3:ContextMenuItem = new ContextMenuItem("Replay
Video",replayIt);
theMenu.customItems[2] = i3;
var i4:ContextMenuItem = new ContextMenuItem("Copyright 2006
VideoLightTV.com",trace,true);
theMenu.customItems[3] = i4;
function pauseIt() {
ns.pause();
function replayIt() {
ns.seek(0);
var vlist:XML = new XML();
vlist.ignoreWhite = true;
vlist.onLoad = function() {
var videos:Array = this.firstChild.childNodes;
for(i=0;i<videos.length;i++) {
videoList.addItem(videos
.attributes.url,videos.attributes.url);
ns.play(videoList.getItemAt(0).data);
videoList.selectedIndex = 0;
var vidList:Object = new Object();
vidList.change = function() {
ns.play(videoList.getItemAt(videoList.selectedIndex).data);
videoList.addEventListener("change",vidList);
vlist.load("videos.xml");Try something like this:
vidList.change = function() {
var nextVideo =Math.floor(Math.random()/videos.length);
ns.play(videoList.getItemAt(nextVideo).data); -
Global Volume Slider (from library) to control drag and drop xml playlist
hi there,
have spent some time doing tutorial and looking online but can't seem to get a volume slider functioning.
the scenario is :
3 circles which can be dragged over a target (one for each circle)
When the circle is placed on its target it loads its respective xml playlist into 4 buttons (play, pause, forward, back)
I want to be able to create some kind of function to control the volume, either using a slider or a rotary dial, whichever is easiest!
any help greatly appreciated!Be sure you include the SoundTransform class...
import flash.media.SoundTransform;
Create a SoundTransform object
...named 'st' (I like short names). Create this AFTER the creation of your soundChannel object...
var st:SoundTransform = channel.soundTransform;
st.volume = 1;//This sets the volume to 100%
channel.soundTransform = st;//This associates your SoundChannel object with your SoundChannel object
Then, for simple testing of this
...create some new button...
halfVol_btn.addEventListener(MouseEvent.CLICK, doHalfVolume);
function doHalfVolume(e:MouseEvent):void{
st.volume = .5;//This sets the volume to 50%
So, now you have a half-baked volume control. Nothing exciting, but this gets you acquainted with the volume part of what you want. You have created, and have access to, the st.volume property to set the volume to whatever you want, from 0 to 1.
Next, I'd suggest that you practice the creation of your own slider. Search online for tutorials on it, like I mention above (as a Flash programmer, this is something I, and you, end up doing - searching - dozens of times a week at times). In the end, the position of your knob/button/control in the slider is a %: What % is the location of the knob on the total width/height of the slider. This % is what you send to the st.volume property.
http://www.lmgtfy.com/?q=create+volume+slider+as3
As an alternative to create your own slider, you can also use the Flash "Slider" component:
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/controls/Slider.html
...but this, too, requires some getting-up-to-speed with using it.
Good luck. If you want some actual code examples - you'll find plenty online :-) -
Help needed to load different xml playlists by clicking button
Hi there,
I have a series of buttons, when i double click a button i want to load a new xml file
I have some functioning code, but when i click on more than one button per run of the application, it will only use the first xml that was clicked / loaded.
Does anyone have any suggestions I would be really grateful
Thanks!
// Music player populated via XML formatted data with associated .mp3 audio files
// songs to play structured as an XMLList class
// displays artist and song title in the interface
cover.visible = false;
cover2.visible = false;
// song list base on an XMLList class
var songList:XMLList;
// total number of songs in list
var songsTotal:Number;
// sound class variable
var sound:Sound;
// sound channnel variable to play, pause and stop the sound
var soundChannel:SoundChannel;
// holds a reference to the current song playing
var currentSong:Number = 0;
// variable to store the song position when paused
var songPosition:Number;
// flag to check if current song is paused
var songPaused:Boolean;
// loader for XML via a URL
var XMLLoader:URLLoader = new URLLoader();
// various buttons to control songs via the interface
next_btn.addEventListener(MouseEvent.CLICK, onNext);
prev_btn.addEventListener(MouseEvent.CLICK, onPrev);
pause_btn.addEventListener(MouseEvent.CLICK, onPause);
play_btn.addEventListener(MouseEvent.CLICK, onPlay);
album1.doubleClickEnabled=true;
album2.doubleClickEnabled=true;
album1.addEventListener(MouseEvent.DOUBLE_CLICK, loadalbum1);
album2.addEventListener(MouseEvent.DOUBLE_CLICK, loadalbum2);
// check the data has loaded correctly
XMLLoader.addEventListener(Event.COMPLETE, processXML);
// this function processes the XML data
function processXML(e:Event):void {
// create an XML playlist structure
var anXMLplayList:XML = new XML(e.target.data);
// associate the playlist songs with the internal song list
songList = anXMLplayList.SONG;
// set the total songs to those found in the XML data
songsTotal = songList.length();
// remove the eventlistener and restore variables
XMLLoader.removeEventListener(Event.COMPLETE, processXML);
XMLLoader = null;
// this function starts the first song in the list
// when the play_btn is pressed via the onPlay function
function playSong(aSong:Number):void {
// variables for the Title, Artist and associated song in the song list
var aTitle = songList[aSong].@TITLE;
var anArtist = songList[aSong].@ARTIST;
var aURL = songList[aSong].@URL;
// populate the interface with the current song data
title_txt.text = aTitle;
artist_txt.text = anArtist;
// check to see if the sound channel is active
if (soundChannel) {
soundChannel.stop();
soundChannel.removeEventListener(Event.SOUND_COMPLETE, onNext);
// create a new sound object
sound = new Sound();
// load the sound from the URL song data
sound.load(new URLRequest(aURL));
// activate the sound channel via the play method
soundChannel = sound.play();
// when the current songh completes - play the next song via the onNext function
soundChannel.addEventListener(Event.SOUND_COMPLETE, onNext);
// this function plays the next song in the list
function onNext(e:Event):void {
// increment the current song
currentSong++;
// reset the current song if no more to play
if (currentSong>=songsTotal) {
currentSong=0;
// else play the current song via the playSong method
playSong(currentSong);
// this function plays the previous song in the song list
function onPrev(e:MouseEvent):void {
currentSong--;
if (currentSong<0) {
currentSong = songsTotal-1;
playSong(currentSong);
// this function pauses the current song playing and sets the boolean flag
// accordingly
function onPause(e:MouseEvent):void {
if (soundChannel) {
songPosition = soundChannel.position;
soundChannel.stop();
songPaused=true;
// this function plays the current song or restarts a paused song
function onPlay(e:MouseEvent):void {
if (songPaused) {
soundChannel = sound.play(songPosition);
songPaused=false;
} else if (!soundChannel) {
playSong(currentSong);
function loadalbum1(e:Event):void {
cover.visible = true;
cover2.visible = false;
// load the XML formated playlist
XMLLoader.load(new URLRequest("playlist1.xml"));
function loadalbum2(e:Event):void {
cover2.visible = true;
cover.visible = false;
// load the XML formated playlist
XMLLoader.load(new URLRequest("playlist2.xml"));You should try to limit the code you post to what is relevant to the problem... it is hard to track things down, especially when your code is not formatted properly with indentations.
I didn't search farther than finding that you remove the event listener for the URLLoader...
XMLLoader.removeEventListener(Event.COMPLETE, processXML);
so if you remove it after you load the first file and do not restore one for it, then chances are you don't "processXML" any more than the first file you load -
Making xml playlist to play swf files inside one swf
Hi,
I have made an swf file and xml playlist.
I want to include swf filepaths in xml playlist so i would be able to choose from my the list, which file i want to play.
My list-component reads data from the xml, but i cannot get the swf files open there.
I will attach my .fla file so you understand what i'm talking about.
the .fla:
http://www.mediafire.com/file/m24dz0gmzwz/Untitled-1.fla
xml file:
http://www.mediafire.com/file/gdyzzymy5mn/swfList.xml
would you guys look at my files? i know i can play .flv files but i want to know how to play swf files inside another swf. The swf files should be loaded to by the xml list.Hi
we want to give some clarifications
As per our requirement we need to play same swf file ( about
5 in number) always.
These swf files are kept in some folder and during run time
we need to play these swf files inside our Mac / windows
application using flash player.
we don't need to play any swf file, but the same swf files
we need a api / sdk to implement this
Any help will be very well appreciated
Sudesh -
Can this be done? XML playlist
What I want is to create a player that can handle SWFs and
FLVs or just FLVs, that load from a XML playlist.
Now I have seen the tutorial (Creating a Dynamic Playlist for
Progressive Flash Video) url:
http://www.adobe.com/devnet/flash/articles/prog_download.html
In that tutorial you have to click to play the next movie,
but I want it to play swf1 or flv1 then 2 then 3 and so on
automatically, then loop and play them again. But I can't find a
tutorial for this anywhere?
Any ideas, I need a detailed tutorial or a working example
FLA
I ask this, because people have sent me bits of code that
means nothing to me? as I don't understand bits of AS, I need a FLA
or a step by step tutorial.
Many thanksas I don't understand bits of AS,
Ahh, the problem! When you get to more specific applications
of actionscript, and flash, you need to get comfortable at least
piecing together what you know. I'd spend a good deal of time on
kirupa.com, or any site like that, where admins create tutorials
often.
In theory what you'll do is build the normal player, powered
by your own xml, then swap out the onRelease event handlers for a
custom "when the .swf / .flv is done" handler.
Let me know if you get anywhere with that. I'll be happy to
walk you through it. -
Problems with FMS2 streaming flv through xml playlist
I've been testing for the first time FMS2 and has been quite
a pain to make it work, I've been able to stream a single flv file
but now that I've tried to stream multiple flv using a xml playlist
(using the same example provided in
http://www.adobe.com/devnet/flash/articles/video_player.html)
and it wont work.
I have IIS and FMS2 in the same computer.
In the example provided by Adobe was an error in
VideoSource.as in line originally was:
my_FLVPlybk.contentPath = nav.attributes.url + "/_definst_/"
+ stream.attributes.name+".flv";
And had to change "/_definst_/" to "_definst_/" to make it
work, since path are:
rtmp://localhost/videsource/_definst_/fish.flv for example
and not:
rtmp://localhost/videsource//_definst_/fish.flv
Once that was solved and tested it works locally (in the same
machine where the server is installed) but when testing from
another computer it doesn't stream any videos.
All the files are place the way it supposed to be in:
\applications\videosource\streams\_definst_ (here are the
videos)
\applications\videosource (here is the main.asc)
Then in IIS:
\Inetpub\wwwroot\playlist (playlist-demo-1.xml,
VideoThumb.as, VideoSource.as, VideoSource2.html, VideoSource2.swf,
SteelExternalAll.swf).
When tested local with
http://localhost/playlist/VideoSource2.html
or
http://localhost/playlist/VideoSource2.swf
works, but
when trying from another computer in the same network or
outside with
http://my_server/playlist/VideoSource2.html
wont stream like I said before.
In the single flv stream (without xml playlist) I seem to be
able to stream, just made a .fla with a FLVPlayback component
pointing to: rtmp://localhost/test/_definst_/test.flv
And trying
http://my_server/test.html
works fine.
I've done the following:
1. Added a MIME type to IIS for .flv and .swf
2. Vhost.xml is open for all networks
(<Allow>All</Allow>)
3. Change the Global Security Settings for the Flash Player
to access the .flv on the IIS server.
4. No firewalls activated (for testing purposes).
And it works with the single .flv stream but not with the
xml playlist and I've run out of ideas or what to do, so I'm in
need of anyone who can help me out and give me some insight.
Thanks in advance.Sounds like a Flash Player security issue because you are
running from a desktop. One of the items that can be different
between Test Movie and a published test is security and any
internet protocol. Flash Security errors fail silently.
Look at
NetConnection.connect
method for the security warnings and references.
If you plan to deploy from a web server, test there and it
will likely work. -
FLV & SWF player with XML Playlist
What I want is to create a player that can handle SWFs and
FLVs or just FLVs, that load from a XML playlist.
Now I have seen the tutorial (Creating a Dynamic Playlist for
Progressive Flash Video) url:
http://www.adobe.com/devnet/flash/articles/prog_download.html
But this populates a list that you have to click to play the
next movie, but I want it to play swf1 or flv1 then 2 then 3 and so
on, then loop. But I can't find a tutorial for this anywhere?
Any ideas, I need a detailed tutorial or a working example?I recently made something like that, but then my project
consultor, made me change to use only flv files.
The project is going to be an internal tv channel for a
university, here in Portugal. First I thought of mixing SWF and
FLV's together, but then it required that someone that used the
system, knew how to program SWF's, because you need to change a
flag (variable) at the end of the playback of the SWF. This change
of flag status indicates that this SWF is over and pass to the next
entry of the playlist. Without this, I think that you would never
know when to go to next entry. so, the code resembled a little like
this:
if ((_root.percen_tx.text == "100%") || (_global.over == 1
&& _global.tipo[_global.num]=="1")) {
_global.over = 0;
_root.percen_tx.text = "";
if (_global.num == (_global.filmes.length-1)) {
_global.num = 0;
switch (_global.tipo[_global.num]) {
case "1" :
loadMovie(_global.filmes[_global.num], _root.swf_cont);
_root.descr_tx.text = "";
_root.percen_tx.text = "";
break;
case "0" :
_root.contentor.my_FLVPlybk.contentPath =
_global.filmes[_global.num];
_root.descr_tx.text = _global.descr[_global.num];
break;
} else {
_global.num += 1;
_root.percen_tx.text = "";
switch (_global.tipo[_global.num]) {
case "1" :
_global.over=0;
loadMovie(_global.filmes[_global.num], _root.swf_cont);
_root.descr_tx.text = "";
_root.percen_tx.text = "";
break;
case "0" :
_root.contentor.my_FLVPlybk.contentPath =
_global.filmes[_global.num];
_root.descr_tx.text = _global.descr[_global.num];
break;
A brief explanantion:
_global.over -> 0 (not over); 1 (is over)
_global.tipo -> value that comes from an xml, and
indicates if this playlist entry is a SWF or a FLV (they go to
different MC's);
_root.percen_tx -> Indicates the percentage of the FLV
file that was already read. "100%" is over
This is not the most efficient way to do it, because you can
use listeners and so on, but at the time I abbandoned this, at this
stage. Now it's only FLV, and only a few lines of code.
You can see the project at www.ipvctv.com
Hope it helped a bit. -
Converting WinAmp (M3U) Playlists Into iTunes (XML) Playlists
Hi. I was wondering if someone could help me out with suggestions on converting my old WinAmp (.m3u) playlists into usable iTunes (.xml) playlists?
I have Windows XP Pro (with the latest Windows updates), and a brand new iPod 160 Gig Classic.
I have used WinAmp as my media player for the longest time. The reason that I haven't created playlists in iTunes is because:
It took me years to customize these Winamp playlists exactly how I want them (you know how that is).
iTunes is a huge program that tends to takes up too many system resources on my PC. I have an older PC, and don't have the time or money to invest in a new system, copy files, set it up, etc.
iTunes somehow modifies an mp3 whenever it is played in iTunes ( I can see that it has been modified in the "Date Modified" column, where my mp3 files are located).
Historically - up until the last year or so, iTunes has not had too much of a problem faithfully importing my Winamp playlists into iTunes (to be transferred onto my iPod).
So, I just got off the phone with Apple Technical Support, Tier 2. I told him that I had the latest version of iTunes (version 10), installed yesterday.
I successfully imported my 90 Gigs of mp3's into the iTunes "Music Library" without a problem.
The problem arose today when I tried to import one of my WinAmp (.m3u) playlists into iTunes, so that I could copy the playlist over onto my iPod. I've done this dozens of times. I've already tried uninstalling and then reinstalling iTunes.
Like I said, I really want to keep these playlists it took a long time to customize the occurrence and frequency of favorite mp3's into those playlists.
The technician said that the latest release of iTunes won't work with Winamp (m3u) playlists. I asked him if he thought it would work again if I downloaded an older version of iTunes. He said that with the new iPod Classic that I have, it will not work with older versions of iTunes (I have no idea why), so that's out. He suggested Googling an "m3u to xml file converter."
I checked on Google and saw a lot of programs that will convert xml files to m3u file format (for reasons unknown to me), but I haven't had any luck online finding a file converter that will faithfully convert my WinAmp (.m3u) playlists TO iTunes (.xml) playlists to use instead, and make iTunes run smoother. Any suggestions?*
* Keep in mind that I'd really prefer to convert my m3u playlists, rather than create all new iTunes playlists from scratch.
Thanks.solgar wrote:
Tried the plug-in with Apple Technical Support. This WinAmp plug-in unfortunately does absolutely nothing.
I went back an read some of the comments and it sounds like it only works with older versions of WinAmp.
Try this http://www.topdownloads.net/software/m3u-to-xml-xspf-converter_2_39472.html
or this python script http://users.musicbrainz.org/~matt/xspf/m3u2xspf
or http://www.softpedia.com/get/Multimedia/Audio/Audio-Convertors/M3UtoXSPF.shtml
Not sure this one will work since it is looking like the latest iTunes no longer supports m3u file sbut worth a try see http://www.burroak.on.ca/m3u2itunes.html -
Require Help with Flash Video XML Playlist
flash devs,
all i'm doing to playin videos from a xml file - (used lots
of info and code from Lee's XML Video Playlist Tutorial)
after spending hours getting this to work correctly in AS3
and how i want it to work i've hit a brick wall
i've got 2 components on stage - vid_select (List) & vid
(Player)
i can load my flv videos from my xml file just perfect but
after the first video is done it stops.
i'd like to have my video player play through the xml file
and then restart at the beginning...
i've attached my code...
if anyone could possibly help me so that it "loops" through
all the video in my xml list that would be
so greatly appreciated...
i'm new to AS and am learning alot but some code gets
complicated and i'm not sure what to add...
thanks in advance
@pixeladdiktAgain thank you for your help in advance...
I put the script folder into the root. As far as the .flv
file it is showing up as being "put" to my web server. when i
checked the root folder it is there. again i am having the same
problem.. the local view works but when i check it on the web it
just shows that there should be a flash video there but it does not
show up.
i created a new root for this test page the new link is..
http://www.wfwa.org/TESTindexfolder/TESTindex.asp
here are the files that are showing up in it...
flashprojectwebvid.fla
flashprojectwebvid.html
flashprojectwebvid.swf
PBSpromo.flv
SteelExternalPlaySeekMute.swf
TESTindex.asp
and the Scripts folder
thanks again for any help.. -
Adding thumbnails to xml playlist
I am new to flash and I have a questions that I think should
be pretty simple but I can't seem to figure it out. I'm creating a
flash page with an xml video player, and my actionscript works
fine, but I would like to add thumbnails to the playlist. Can
anyone help me with that. Below is the actionscript that I am
using.Why not try it and find out?
-
I'm creating xml player. xml process and playing single video is fine. i stuck at multiple videos playing. give me any solution please..?
i have 3 buttons, if i click button_1 play first video, or if i click button_3 play 3rd video.
how to attach videoURL = playlist files.
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("video_list.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
myXML = new XML(e.target.data);
trace(myXML.Video[0]);
button_1.addEventListener(MouseEvent.CLICK, btn1Click);
button_2.addEventListener(MouseEvent.CLICK, btn2Click);
function btn1Click(e:MouseEvent):void
ns.play(myXML.Video[0]);
function btn2Click(e:MouseEvent):void
ns.play(myXML.Video[1]);
var videoURL:String;
//var videoURL:String = "http://www.helpexamples.com/flash/video/cuepoints.flv";
var nConnection:NetConnection;
var ns:NetStream;
var video:Video = new Video();
nConnection = new NetConnection();
nConnection.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
nConnection.connect(null);
function netStatusHandler(event:NetStatusEvent):void
switch (event.info.code)
case "NetConnection.Connect.Success" :
connectStream();
break;
case "NetStream.Play.Stop" :
break;
default :
function connectStream():void
ns = new NetStream(nConnection);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
vidDisplay.attachNetStream(ns);
ns.play(videoURL);
XML
<?xml version="1.0" encoding="utf-8"?>
<Playlist>
<Video Title="Chapter 1">media/video_1.flv</Video>
<Video Title="Chapter 2">media/video_2.flv</Video>
</Playlist>everything should work as long as you wait for xml loading to complete before clicking your buttons. you can disable those buttons when you app starts and enable them in processXML.
var videoURL:String;
var myXML:XML;
var myLoader:URLLoader = new URLLoader();
myLoader.load(new URLRequest("video_list.xml"));
myLoader.addEventListener(Event.COMPLETE, processXML);
function processXML(e:Event):void
button_1.enabled=true;
button_2.enabled=true;
myXML = new XML(e.target.data);
trace(myXML.Video[0]);
button_1.addEventListener(MouseEvent.CLICK, btn1Click);
button_2.addEventListener(MouseEvent.CLICK, btn2Click);
button_1.enabled=false;
button_2.enabled=false;
function btn1Click(e:MouseEvent):void
videoURL=myXML.Video[0];
ns.play(myXML.Video[0]);
function btn2Click(e:MouseEvent):void
videoURL=myXML.Video[1];
ns.play(myXML.Video[1]);
var nConnection:NetConnection = new NetConnection();
nConnection.connect(null);
var ns:NetStream = new NetStream(nConnection);
ns.addEventListener(NetStatusEvent.NET_STATUS, netStatusHandler);
var video:Video = new Video();
video.attachNetStream(ns);
addChild(video);
function netStatusHandler(event:NetStatusEvent):void {
// you have no useful code here
play_btn.addEventListener(MouseEvent.CLICK, playClicked);
pause_btn.addEventListener(MouseEvent.CLICK, pauseClicked);
play_btn.visible = false;
var videoPaused:Boolean = false;
function playClicked(e:MouseEvent):void{
if(!videoPaused)
ns.play(videoURL);
else
ns.resume();
play_btn.visible = false;
function pauseClicked(e:MouseEvent):void
ns.pause();
play_btn.visible = true;
videoPaused = true; -
XML Playlist for flipping book
I am working on a flipping book and want to use XML for the
video playlist.
I can't seem to get the first video to start playing in
myVideoplayer_mc?
Any help would be greatly appreicated.
Thank so much."level0"! I wish that would have been mentioned somewhere in
all the tutorials I've been reviewing... that would have helped. I
could have missed it too.
Thanks so much for all the help.
My video's are still not playing. I don't think I have my
onRelease statements as clean and as correct as they could be. Not
sure if I need to have so many or if I can do the same thing with
fewer onRelease statements? Is it ok to start with "this." or
should I be more specific?
Revised page 11 code attached...
Maybe you are looking for
-
Cp5 edit background in Photoshop not working
I'm trialling Cp5 and one of the key deciders is the Photoshop workflow. On my usual workstation I have Cp4 and the standalone version of Photoshop CS3 extended and the CTRL-U background edit just works. The workstation I'm trialling Cp5 on has the C
-
How do I insert a hyperlink in Keynote 6.1?
How do I insert a hyperlink in Keynote 6.1? The newer verision is very difficult to find previous commands and I do not like the Inspector. So many options have been removed.
-
The following error message is displayed in firefox when I try to load popular websites: The connection has timed out The server at www.yahoo.com is taking too long to respond. * The site could be temporarily unavailable or too busy. Try again in a f
-
After installing the security update from 21.04.2015 my Phone does not start any more
Hi everybody, I have installed the update 10052 for my Lumia 535 DS and now it can't be started any more. When starting the phone the two gears appear and start moving but than it's turned off. This happens each time I'm trying to start the phone. An
-
What's the best practice to manage the page file?
We have one Hyper-v Server running windows 2012 R2 with 128 GB RAM and 2 drives (C and D). It setup Automatically manage page file size for all drives. What's the best practice to manage the page file? Bob Lin, MCSE & CNE Networking, Internet