Name is required.
Email address is required.
Invalid email address
Answer is required.
Exceeding max length of 5KB

JW Player 6 - add button


Good day to everyone.
Sorry for another addbutton post, but information from previous threads:
http://www.longtailvideo.com/support/forums/jw-player/player-development-and-customization/20983/preferred-method-for-adding-a-button/
http://www.longtailvideo.com/support/forums/jw-player/player-development-and-customization/22494/add-button-controlbar-on-custom-skin/
http://www.longtailvideo.com/support/forums/jw-player/player-development-and-customization/21765/plugin-addbutton-removebutton-addbutton/
didn't help me.
I wrote a simple flash plugin
bc.. public class TextPlugin extends Sprite implements IPlugin6 {

[Embed(source="/../assets/translate32.png")]
private const ControlbarIcon:Class;

private var _button:MovieClip;
private var _config:PluginConfig;
private var _icon:DisplayObject;
private var _player:IPlayer;

private function _clickHandler(event:MouseEvent):void {
Alert.show("klicked the button");
};
/** This function is automatically called upon load. **/
public function initPlugin(ply:IPlayer, cfg:PluginConfig):void {
_player = ply;
_config = cfg;
_icon = new ControlbarIcon();
_player.controls.controlbar.addButton(_icon, "trans", _clickHandler);
_player.redraw();
}
/** This should be the lowercase name of the plugin SWF file. **/
public function get id():String {
return "textplugin";
}
/** This should be the player version the plugin is targeted for. **/
public function get target():String {
return "6.0";
}
/** This is called when the player resizes. **/
public function resize(width:Number, height:Number):void {
}
}



embedded it into html page
bc.. <head>
<title>Player</title>
<script type="text/javascript" src="./jwplayer/jwplayer.js"></script>
</head>
<body>
<table width="auto">
<div id="myElement" width="100%">Loading the player...</div>
</table>

<script type="text/javascript">
jwplayer("myElement").setup({
file: "./uploads/myVideo.mp4",
image: "./uploads/myPoster.jpg",
skin: "./skins/newtubedark/newtubedark.xml",
primary: 'flash',
plugins: {
"./plugins/TextPlugin.swf": {}
}

});
</script>

</body>



but still didn't see any added button.
Here is the image -
https://docs.google.com/file/d/0Bz4zF4NJlF6hT2lMcGxIYlBxZ3c/edit?usp=sharing
Any ideas what is wrong?

5 Community Answers

Ethan Feldman

JW Player Support Agent  
0 rated :

Where is this running ?

JW Player

User  
0 rated :

to * Ethan LongTail *
the html-page is hosting on local webserver (VertrigoServ 2.29) and is accessing through http://127.0.0.1:8080/index_.html

Ethan Feldman

JW Player Support Agent  
0 rated :

Oh, if you are using JW6 you can’t add a custom controlbar icon.

JW Player

User  
0 rated :

So, what should I do, if I need to add couple custom fields at controlbar:
1) button with switch audio streams functionality
2) horizontal volume slider

And rearrange default buttons?

Ethan Feldman

JW Player Support Agent  
0 rated :

It is not possible to do that.

This question has received the maximum number of answers.