FORUMS: list search recent posts

Flash Video Playlist

COW Forums : Adobe Flash

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Kevin White
Flash Video Playlist
on Nov 23, 2012 at 2:06:03 am

Hello I followed a tutorial I found on Adobe to create a dynamic video playlist and all worked ok then I wanted to add captions to my video and the code they suggested to add to the actionscript made the captions button on the skin disappear. The captions played ok but the button on the skin was not there any longer and the captions just automatically played. I would like to use the captions button on the skin to control each of the captions for the respective videos. Here's the as file . .

package {
import flash.display.MovieClip;
import flash.net.URLLoader;
import flash.net.URLRequest;
import flash.events.Event;
import fl.controls.listClasses.CellRenderer;
import fl.controls.ScrollBarDirection;
import flash.text.TextFormat;

public class VideoPlaylist extends MovieClip {
private var xmlLoader:URLLoader;
private var textStyle:TextFormat;

public function VideoPlaylist():void {
// Load the playlist file, then initialize the media player.
xmlLoader = new URLLoader();
xmlLoader.addEventListener(Event.COMPLETE, initMediaPlayer);
xmlLoader.load(new URLRequest("playlist.xml"));
// Format the tileList, specify its cellRenderer class.
tileList.setSize(200, 240);
tileList.columnWidth = 180;
tileList.rowHeight = 60;
tileList.direction = ScrollBarDirection.VERTICAL;
tileList.setStyle("cellRenderer", Thumb);
textStyle = new TextFormat();
textStyle.font = "Tahoma";
textStyle.color = 0xFF0000;
textStyle.size = 11;
tileList.setRendererStyle("textFormat", textStyle);
}


public function initMediaPlayer(event:Event):void {
var myXML:XML = new XML(xmlLoader.data);
var item:XML;
for each(item in myXML.vid) { // populate playlist.
// Get thumbnail value and assign to cellrenderer.
var thumb:String;
if(item.hasOwnProperty("@thumb")>0) thumb = item.@thumb;
// Send data to tileList.
tileList.addItem({label:item.attribute("desc").toXMLString(),
data:item.attribute("src").toXMLString(),
ttURL:item.attribute("ttURL").toXMLString(),
source:thumb});
}
// Select the first video.
tileList.selectedIndex = 2;
myVid.autoRewind = true;
// Listen for item selection.
tileList.addEventListener(Event.CHANGE, listListener);
// And automatically load it into myVid.
myVid.source = tileList.selectedItem.data;
myVidCaptioning.source = tileList.selectedItem.ttURL;
myVidCaptioning.flvPlayback = myVid;
// Pause video until selected or played.
myVid.pause();
}


// Detect when new video is selected, and play it
function listListener(event:Event):void {
myVid.stop();
myVidCaptioning.source = event.target.selectedItem.ttURL;
myVidCaptioning.showCaptions = false;
myVidCaptioning.showCaptions = true;
myVid.autoPlay = true;
myVid.play(event.target.selectedItem.data);
}
}
}


any ideas on how I can retain that video caption button on the skin I choose?


Return to posts index

demetri tashie
Re: Flash Video Playlist
on Nov 27, 2012 at 12:59:32 am

can you add a link to the tutorial you looked at?

are you coding your player or using a component, and therefore a component 'skin' with a caption button?


Return to posts index

Kevin White
Re: Flash Video Playlist
on Nov 27, 2012 at 2:10:05 pm

Sure Demetri,
Here's the tutorial
http://www.adobe.com/devnet/flash/articles/video_playlist.html
This played without a hitch and all worked fine. Then I added some captions from this link . . .
http://www.flashconnections.com/ - same author
When I added the local variable "ttURL" to the constructor of the VideoPlaylist class the caption button, I believe from the swf, disappeared.
Also if it's helpful here is a link to my files and sample playlist
user: Demetri
Password: playlist2012

Let me know if I can be of greater assistance or perhaps provide you with more information for my ultimate edification.

Thanks Demetri,
appreciate your help!


Return to posts index


demetri tashie
Re: Flash Video Playlist
on Nov 30, 2012 at 3:04:36 am

i'm not seeing the 2nd tutorial ( it is her blog, but where is that tutorial ??)

and no link toyour files


Return to posts index

Kevin White
Re: Flash Video Playlist
on Dec 1, 2012 at 12:57:56 am

Hello Demetri,
Here's that second link again. I was behind a firewall and couldn't verify this was the right one

http://www.flashconnections.com/2009/06/24/adding-captioning-to-dynamic-pla...

and that link I didn't supply . . . . duh is

http://www.mihalyi.us/rhpi


user: "Demetri"
Pass: "playlist2012"


Thanks again Demetri


Return to posts index

demetri tashie
Re: Flash Video Playlist
on Dec 7, 2012 at 2:03:13 pm

hi kevin,

that is way too many files for me to look through! the thing that i am initially seeing though, is that she uses a video component that does not have a caption button, and instead adds a separate FLVPlayback Captioning component to the file.

you might want to go back into your files, and swap out the skion you chose for one without a caption button, and add a button like she does. if that works, then we can assume there is some bug or conflict that was causing the issue. if not, further trouble shooting would be in order to double check your code against the source code.

do try swapping it out, and please let us know what you find out.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2018 CreativeCOW.net All Rights Reserved
[TOP]