Go
Not registered? Sign up!

Control Playback from inside a skin?

Google Translate
6 posts | return to the Skins forum | get the rss feed for this thread

Jun. 23, 2009Peter Mee

Hi

I'm building a chapter selector into my skin. See http://www.meedja.com/clients/webfact/mediaplayer/testpage.html

If you click on the chapter selection tap on the left side, you'll see the idea.

I'm happy to hardcode the chapter selectors into the skin across several frames and jump to the frame on pop-out based on what's playing.

However, I need the Actionscript code access the following properties from an MC inside the Player MC in the skin;

1. Get the clip name currently playing
2. Set the time/chapter marker of the currently playing video clip

To be clear, this chapter selector is an indemepdent MC inside the Player MC in the skin .swf.

I'm looking for something like the following ;

currentFlvTitle = (this.parent.parent as MovieClip).player.title;
(this.parent.parent as MovieClip).player.goto("chaptermarker2");

All help appreciated

Peter

Jun. 24, 2009Peter Mee

Never mind, I built a plugin to do the job

Oct. 05, 2009raffaele

Hi, i'm interessed this job.
i want purchase this skin.
Are you interessed?


perrelliraf@hotmail.com

Nov. 10, 2009Vioo

This seems to be a common theme on this "support" forum. Somebody asks a question, waits a while, and finally reports back "Never mind," and no answers are ever provided.

How does this qualify as "support" again??

Nov. 11, 2009hobbs

 
It's a FREE, VOLUNTARY, user-to-user support Forum.

If you want PAID support, you should contact Longtail Video directly, from their Contact Page.

Nov. 11, 2009Vito

I understand it's free and voluntary... it's the "support" part that I question. Perhaps if people would report back with their solutions (rather than just saying "never mind" or "I found it"), the forum might offer more than just an echo chamber of frustration.

Many of these questions (such as this one) appear over and over again throughout the forum, which makes me wonder if anyone ever came up with a solution.

Which makes me wonder about the thoroughness of the documentation available for the licensed product. Longtail is under no obligation to respond to these questions, but it might be nice if they addressed the oft-repeated issues elsewhere in their wiki/documentation.


***

And now to contribute toward finding a solution:

Here's what I did to get around the limitations mentioned in the original post:

I could find no way for the skin (aka the child SWF) to communicate directly with its parent container (aka the player), but since both SWFs can use ExternalInterface() calls to communicate with the containing HTML/Javascript, you can use this to pass information between the two.


For instance,


Javascript:
-----------

// This function is called automatically when the
// JWPlayer is ready to begin accepting calls through
// the Javascript API. This is where we can get the
// information we need about the player itself, AND
// set up listeners to handle player events as they
// happen...

function playerReady(obj) {
// Get a reference to the player...
var player = document.getElementById(obj['id']);
// Add a listener so the "changeTheSkin() function is triggered when a new item is queued...
player.addControllerListener("ITEM", "changeTheSkin"); // changeTheSkin() is a JS function defined below...
}

// Here's the function triggered by the player (via the
// listener above) each time a new item is queued

function changeTheSkin (obj) {
var player = document.getElementById(obj['id']); // Get the player...
var currentItem = player.getPlaylist()[obj.index]; // And get the playlist object for the currently played
// item
player.updateSkinElements(currentItem.title) // Now, send its title (or whatever you need...) right
// back to the player,
// where the skin will now intercept it through the AS3
// callback function defined next.
}




For this to work, the player skin must also be configured to accept the title when the JS updateSkinElements() function is called:

AS3 within the custom skin:
---------------------------

// Add a callback so that when the JS function
// player.updateSkinElements() is called, the AS3
// function updateSkinToReflectTitle() is triggered...

ExternalInterface.addCallback ("updateSkinElements", updateSkinToReflectTitle);

// And define the AS3 function
function updateSkinToReflectTitle (title:String) {
// And here, we do whatever we need to do to
// update the skin to reflect the current track
// info...
someclip.text = title;
}



The jwplayer Javascript API docs (and FlashVars listings) should give you an idea of the kinds of things available through the JS API. Hope this helps!

Add a reaction

You can also return to the category or try this search for related threads.


 

Search the Forums

Go

Support

Support Here are some helpful links to learn more about the JW Player™:

Monetize Your Video

Monetize Your Video Earn money with ads from LongTail's AdSolution. Watch our demos and sign up now!

Why Buy a License?

Why Buy a License? If you don’t buy a commercial license, you cannot use a JW Player™ on (i) a site that has ads; (ii) a corporate site; or a (iii) CMS. Our licenses are very inexpensive, so what are you waiting for? Buy a license today.