Order Now AdSolution Sign Up | Login » Bits on the Run Sign Up | Login »

Forums

/

Add Button controlbar on custom skin

16 replies [Last post]
Reply

Hello,

I ve currently develop a skin plugin and a flash plugin.
Flash plugin add correctly my custom button on controlbar with default skin. But when i decide to enable my custom skin, button dont appear..

I search about blankButton but it dont appear too ...

Any idea ?
Thanks

Philippe

Reply

@Philippe -

Please post a link to an example page which shows your plugin with and without your custom skin.

Reply

Hi Pablos,

Here is the Link
at p.vr.free.fr/jwplayer/default.html

Thanks

Reply

Just a little "up"

Reply

@Philippe -

Nothing appears wrong with adding controlbar buttons to your skin itself. For example, if you use the hd plugin instead of your custom plugin, the HD icon appears in the controlbar.

Example:

jwplayer().setup({
...
      'plugins':'hd',
      'hd.file':'foo2.mp4',
      dock:false,
..
});

I'd have to see your plugin's source code to understand why it's not showing up in the custom skin.

Reply

@Philippe

Did you find the way how to do it?
Thanks.

Reply

I added button by editing sourcecode

In ControlBarComponents.as setupDefaultButtons()
added

addComponentButton('stuff', ViewEvent.JWPLAYER_VIEW_STUFF);

In ViewEvent.as
added

public static var JWPLAYER_VIEW_STUFF:String = "jwplayerViewStuff";

In Controller.as
added

protected function stuffHandler(evt:ViewEvent):void { stuff(); }

added


public function stuff():Boolean {

trace("My Stuff clicked");

if(_model.config.stuffurl) {
var url:URLRequest = new URLRequest(_model.config.stuffurl);

var target:String = '_self';
if(_model.config.stufftarget) {
target = _model.config.stufftarget;
}

navigateToURL(url, target);
}

return true;
}

in addViewListeners()
added

_view.addEventListener(ViewEvent.JWPLAYER_VIEW_STUFF, stuffHandler);

In PlayerConfig.as
added

protected var _stuffurl:String = null;
protected var _stufftarget:String = "_self";

In skin xml configuration in the layout section added

<button name='stuff' />

In the elements esction added

<element name="stuffButton"     src="stuffButton.png" />
<element name="stuffButtonOver" src="stuffButtonOver.png" />

In the html added new parameter:

                        jwplayer("player").setup({
                            width: width,
                            height: height,
                            stuffurl: 'http://www.google.com', 
...

I got new button I can click on and it will redirect me to the stuffurl

Reply

Hello,
I did exactly what @Powerhead says. I compiled my player. All is ok, but there is no new 'stuffButton' !!
I compiled with five.swf as defaultSkin, and then with dangdang.swf
When I don't call my XML skin, I can see that my compiling is ok because de defaultSkin changes.

Do I have to modify the defaultSkin .fla file too ?... Or is there something else I did wrong ?

Reply

Nobody can answer me ?... :-(

Reply

@Fabrice -

@Powerhead's solution referred to an XML skin, not a compiled-in SWF skin. I believe you'll need to use an XML skin to get his solution to work.

Reply

Thanks for your answer @PabloS
But, even when I add an XML skin to my compiled player, I can't see my new button...
That's why I asked if I had to modify the .fla file too.

Reply

Fabrice -

If you post a link to an example page along with your player customizations (including plugin and player source code), I can take a quick look. Keep in mind, I can't promise direct support for this sort of player customization, since this is not an officially supported method.

Reply

Hi,
Thank you very much, PabloS !!!

Here are the links:

- HTML page embeding my player: http://www.esav.fr/jwplayerF/index.html

- The player I compiled: http://www.esav.fr/jwplayerF/player.swf

- The XML skin I use: http://www.esav.fr/jwplayerF/esav_skin.zip

- The "trunk" directory with the Powerhead's mods code: http://www.esav.fr/jwplayerF/trunk_F.zip

That's all what I use.
Thank's for your help.

Reply

@Fabrice:

You need one more modification in ControlbarComponent.as:

protected var _defaultLayout:String = "[play|stop|prev|next|elapsed][time][duration|blank|stuff|fullscreen|mute volume]";

Keep in mind, this sort of thing would be much better done as a Flash plugin, using the Controlbar.addButton() API.

Reply

THANK YOU VERY MUCH PabloS !!!
It runs !!!
http://www.esav.fr/jwplayerF/index.html

I'll have a look to Controlbar.addButton() API...

Really, a great, great thank's for your help.

Reply

I'm trying to do the same thing but with support for both Flash & HTML5. Is that possible? Seems like it was for 5.0-5.2 but then got removed.

Reply

@Jonathan -

You can only add a controlbar button in Flash mode. It's a much different story in HTML5 mode - it can be done by modifying the player's source code, but it isn't actually a supported use case.

Post new comment

  • Allowed HTML tags: <code> <blockquote> <em> <strong> <strike> <ul> <li> <ol>
  • You may post code using <code>...</code> .
  • Lines and paragraphs break automatically.
  • Web page addresses and e-mail addresses turn into links automatically.

More information about formatting options