
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?