in the
org.flowplayer.viralvideos.iconBar.as
you can find the error, because the embedIcon position is calculated by the emailIcon.y which in case is doesnt exist :D
As well as a lot of such errors in ViralVideos.as, see below for the fixes :)
Wonder if anyone here would ever used try...catch blocks.
You may want to modify and recompile this plugin, I had to.
Someone please FIX this in the repo,
Cheers
private function createIcons():void {
var ny:Number = 0;
if (_config.email) {
_emailIcon = new EmailIcon(_config.iconButtons, _player.animationEngine);
addChild(_emailIcon);
}
log.debug("icon bar props " + _config.embed);
if (_config.embed) {
_embedIcon = new EmbedIcon(_config.iconButtons, _player.animationEngine);
addChild(_embedIcon);
ny = _emailIcon ? _emailIcon.y + _emailIcon.height + 5 : 0
_embedIcon.y = ny;
}
if (_config.share) {
_shareIcon = new ShareIcon(_config.iconButtons, _player.animationEngine);
addChild(_shareIcon);
ny = _embedIcon ? _embedIcon.y + _embedIcon.height + 5 : ny
_shareIcon.y = ny;
}
var props:DisplayProperties = _config.iconDisplayProperties;
props.setDisplayObject(this);
log.debug("icon bar props " + props.dimensions);
_player.addToPanel(this, props);
}
override protected function onResize():void {
log.debug("onResize() " + width + " x " + height);
var horizontal:Boolean = width > height;
var ny:Number = 0;
var nx:Number = 0;
nx = _emailIcon ? _emailIcon.x + _emailIcon.height + 5 : 0;
ny = _emailIcon ? _emailIcon.y + _emailIcon.height + 5 : 0;
if (horizontal) {
resizeIcon(height);
_embedIcon.x = nx;
_shareIcon.x = _embedIcon ? _embedIcon.x + _embedIcon.width + 5 : nx;
} else {
resizeIcon(width);
_embedIcon.y = ny;
_shareIcon.y = _embedIcon ? _embedIcon.y + _embedIcon.height + 5 : ny;
}
}
private function resizeIcon(dim:Number):void {
try{
_embedIcon.height = _embedIcon.width = dim;
}catch(e:Error){};
try{
_emailIcon.height = _emailIcon.width = dim;
}catch(e:Error){};
try{
_shareIcon.height = _shareIcon.width = dim;
}catch(e:Error){};
}
public function onEmail(listener:Function):void {
try{
addIconClickListener(_emailIcon, listener);
}catch(e:Error){}
}
public function onEmbed(listener:Function):void {
try{
addIconClickListener(_embedIcon, listener);
}catch(e:Error){}
}
public function onShare(listener:Function):void {
try{
addIconClickListener(_shareIcon, listener);
}catch(e:Error){}
}
private function onPlayerLoad(event:PlayerEvent):void {
_playerEmbed = new PlayerEmbed(_player, _model.name, stage, stage.loaderInfo.parameters["config"]);
_config.playerEmbed = _playerEmbed;
createViews();
initializeTabProperties();
createTabs();
_autoHide = new AutoHide(null, _config.autoHide, _player, stage, _iconBar);
_autoHide.hide();
_autoHide.onShow(onButtonsShow);
_autoHide.start();
hideViews();
if (_emailView){
setActiveTab("Email", false);
_emailView.show();
}
if (_embedView){
setActiveTab("Embed", false);
_embedView.show();
}
if (_shareView){
setActiveTab("Email", false);
_shareView.show();
}
}