Synchronize video playback with image playback

Hey guys, I was wondering how can we synchronize a video playback with an image slideshow, what I would like to achieve is to have the image slideshow playback follow the sequence of a video playlist, so supposing I have item 1(a video) playing I would want the item 1(image) show up for the duration of the video and change to the following image when item 2(video) starts playing.
Any ideas? Should I have one playlist for both videos and images or two seperate playlists, one for video and one for images?

I’m open to suggestions as long as i can get the image playback to follow the video playback.

Thanks in advance.

Are you loading contents externally ??

yes, I am loading contents externally using an XML playlist. :slight_smile:

Since you have to synchronize one image per video, its easier since you dont need cuepoints. Can you explain me your scenario so i can help you better?

alright, the scenario is like this:

I have four items running on playlist in my movie(let’s call them channels)
Channel 1 = video
Channel 2 = image 1
Channel 3 = image 2
Channel 4 = image 3

Now I am using one xml playlist to play through all my videos and another playlist to play through my images and text in channels 2-4.

What I want to achieve is:
When Channel 1 plays item 1 in the video playlist, Channels 2-4 will play item 1 in the image playlist and cycle through the images available in each Channel(2-4) in a set amount of time. When item 1(video) finishes playing in Channel 1, Channels 2-4 will finish as well and follow Channel 1 in playing the second set of items.

Example playlist for my videos(Channel 1):

<?xml version=“1.0” encoding=“iso-8859-1”?>
<playlist>

<video messages=“X Men 3” flv=“flv/xmen3.flv” item=“0”/>
<video messages=“Fantastic Four” flv=“flv/fantastic4.flv” item=“1”>
<video messages=“Prisoner of Azkaban” flv=“flv/azkaban.flv” item=“2”/>
<video messages=“Panasonic Viera” flv=“flv/viera.flv” item=“3”/>
<video messages=“Avex Trax” flv=“flv/avex.flv” item=“4”/>
<video messages=“Lumix” flv=“flv/lumix.flv” item=“5”/>

</playlist>

Example playlist for the images(Channels 2-4):
*Note: not all the channels will have multiple items in it
<?xml version=“1.0” encoding=“utf-8” standalone=“yes”?>
<images>
<items>
<channel2>
<images>images/ch2/ss310.jpg</images>
<images>images/ch2/ss305.jpg</images>
<images>images/ch2/ss306.jpg</images>
</channel2>
<channel3>
<images>images/ch3/ss308.jpg</images>
<images>images/ch2/ss309.jpg</images>
</channel3>
<channel4>
<messages>Testing Channel 4</messages>
</channel4>

&lt;/items&gt;

&lt;items&gt;
    &lt;channel2&gt;
            &lt;images&gt;images/ch2/ss305.jpg&lt;/images&gt;
    &lt;/channel2&gt;
    &lt;channel3&gt;
            &lt;images&gt;images/ch3/ss309.jpg&lt;/images&gt;
            &lt;images&gt;images/ch2/ss307.jpg&lt;/images&gt;
    &lt;/channel3&gt;
       &lt;channel4&gt;
            &lt;messages&gt;Network Casting Test&lt;/messages&gt;
    &lt;/channel4&gt;

&lt;/items&gt;

&lt;items&gt;
    &lt;channel2&gt;
            &lt;images&gt;images/ch2/ss306.jpg&lt;/images&gt;
    &lt;/channel2&gt;
    &lt;channel3&gt;
            &lt;images&gt;images/ch3/ss307.jpg&lt;/images&gt;
    &lt;/channel3&gt;
       &lt;channel4&gt;
            &lt;messages&gt;Hello, testing testing&lt;/messages&gt;
    &lt;/channel4&gt;

&lt;/items&gt;

&lt;items&gt;
    &lt;channel2&gt;
            &lt;images&gt;images/ch2/ss306.jpg&lt;/images&gt;
    &lt;/channel2&gt;
    &lt;channel3&gt;
            &lt;images&gt;images/ch3/ss307.jpg&lt;/images&gt;
    &lt;/channel3&gt;
       &lt;channel4&gt;
            &lt;messages&gt;Hello, testing testing&lt;/messages&gt;
    &lt;/channel4&gt;

&lt;/items&gt;    

</images>

it sounds simple but yet complicated but i’m definitely having a headache with it at the moment, hope you can help me out with this bro, deadline’s coming in soon :frowning:

my code for playing Channels 2-4 simultaeously:

delay = 15000;
//-----------------------
function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
image3 = [];
messages = [];
total = xmlNode.childNodes.length;
subtotal = xmlNode.childNodes.childNodes.childNodes.length;

for (var q=0; q<total; q++) {

image[q] = xmlNode.childNodes[q].childNodes[0].childNodes[0].firstChild.nodeValue;
image3[q] = xmlNode.childNodes[q].childNodes[1].childNodes[0].firstChild.nodeValue;
messages[q] = xmlNode.childNodes[q].childNodes[2].childNodes[0].firstChild.nodeValue;

}

firstImage();

} else {

content = “file not loaded!”;

}

}

xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“channel2.xml”);

p = 0;

function nextImage() {

if (p<(total-1)) {

p++;

if (loaded == filesize) {

picture2._alpha = 0;
picture2.loadMovie(image[p], 1);
picture3._alpha = 0;
picture3.loadMovie(image3[p], 1);
desc_txt2.text = messages[p];
slideshow();

}

}

}

function firstImage() {

if (loaded == filesize) {

picture2._alpha = 0;
picture2.loadMovie(image[0], 1);
picture3._alpha = 0;
picture3.loadMovie(image3[0], 1);
desc_txt2.text = messages[0];
slideshow();

}

}

function slideshow() {

myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {

clearInterval(myInterval);
if (p == (total-1)) {

p = 0;
firstImage();

} else {

nextImage();

}

}

}

my code for playing through my video playlist

var xml:XML = new XML();
xml.ignoreWhite = true;

xml.onLoad = function(i) {
var nodes = this.firstChild.childNodes;
for(var i=0; i<nodes.length; i++) {
list.addItem(nodes*.attributes.desc, nodes*.attributes.flv,
nodes*.attributes.item);

}

    vid.play(list.getItemAt(0).data)
    list.selectedIndex = 0;

}

xml.load(“playlist.xml”);

var lList:Object = new Object();
lList.change = function() {
vid.play(list.getItemAt(list.selectedIndex).data);
count = list.selectedIndex;
}

list.addEventListener(“change”, lList);

var vidList:Object = new Object();
var count:Number = 0;

vidList.complete = function() {
if(seq.selected) {
if(count == list.length-1){
count = 0;
}
else {
count++;
}
}
else {
var temp = count;
while(temp == count) {
count = Math.floor(Math.random()*list.length);
}
}

vid.play(list.getItemAt(count).data);
list.selectedIndex = count;

}

vid.addEventListener(“complete”, vidList);

I have the codes on the first keyframe of seperate time lines. Does that affect anything?

ya I do not want to use cuepoints, cause I want to be able to easily add or change new content using the playlist.

knock knock, anybody out there that can help me out with this?

any ideas claudio?
really appreciate the help.