Commit 295d5f11 authored by Dan Rossi's avatar Dan Rossi
Browse files

- #44 fixes for #627 check if the stagevideo dimensions and positioning has...

- #44 fixes for #627 check if the stagevideo dimensions and positioning has changed to update the stage video mask with.
unbinding and binding stage video events caused issues with instream playlists therefore has to be kept binded.
unbinded stage video events during seeking to prevent the mask repositioning.
parent 051a2f63
......@@ -8,6 +8,9 @@ Version history:
- #20 for the free player swap the logo with the stage video mask to display underneath not on top.
- #42 pass in stream clips through and close the stream before returning to the parent clip.
- #52 when replaying flag start has dispatched on the current clip.
- #44 fixes for #627 check if the stagevideo dimensions and positioning has changed to update the stage video mask with.
unbinding and binding stage video events caused issues with instream playlists therefore has to be kept binded.
unbinded stage video events during seeking to prevent the mask repositioning.
3.2.14
------
......
......@@ -25,12 +25,12 @@ package org.flowplayer.view {
import org.flowplayer.controller.PlayListController;
import org.flowplayer.controller.ResourceLoader;
import org.flowplayer.controller.ResourceLoaderImpl;
import org.flowplayer.flow_internal;
import org.flowplayer.flow_internal;
import org.flowplayer.model.Callable;
import org.flowplayer.model.Clip;
import org.flowplayer.model.ClipEvent;
import org.flowplayer.model.ClipEventType;
import org.flowplayer.model.DisplayPluginModel;
import org.flowplayer.model.ClipEventType;
import org.flowplayer.model.DisplayPluginModel;
import org.flowplayer.model.DisplayProperties;
import org.flowplayer.model.DisplayPropertiesImpl;
import org.flowplayer.model.ErrorCode;
......@@ -102,7 +102,11 @@ import org.flowplayer.model.DisplayPluginModel;
private var _clickTimer:Timer = new Timer(200, 1);
private var _clickEvent:MouseEvent;
private var _screenMaskWidth:Number;
private var _screenMaskHeight:Number;
private var _screenMask:Sprite;
private var _stageEventCount:Number;
[Frame(factoryClass="org.flowplayer.view.Preloader")]
public function Launcher() {
......@@ -740,14 +744,19 @@ import org.flowplayer.model.DisplayPluginModel;
//#508 disabling the stagevideo screen mask, canvas is visible without it.
CONFIG::FLASH_10_1 {
_flowplayer.playlist.onStageVideoStateChange(onStageVideoStateChange);
_flowplayer.playlist.onStageVideoStateChange(onStageVideoStateChange);
//#44 fixes for #627, now bind and unbind stagevideo events during seeking to prevent the mask repositioning.
_flowplayer.playlist.onBeforeSeek(function(event:ClipEvent):void {
_flowplayer.playlist.unbind(onStageVideoStateChange);
});
//#627 re-enable stagevideo state change listeners if stagevideo is available or detach the fullscreen events on first call.
_flowplayer.onFullscreen(onStageVideoFullscreen);
_flowplayer.onFullscreenExit(onStageVideoFullscreen);
_flowplayer.playlist.onSeek(function(event:ClipEvent):void {
_flowplayer.playlist.onStageVideoStateChange(onStageVideoStateChange);
});
}
}
private function onMouseOut(event:MouseEvent):void {
_flowplayer.dispatchEvent(PlayerEvent.mouseOut());
}
......@@ -757,56 +766,54 @@ import org.flowplayer.model.DisplayPluginModel;
}
//#508 disabling the stagevideo screen mask, canvas is visible without it.
CONFIG::FLASH_10_1 {
CONFIG::FLASH_10_1 {
private function onStageVideoStateChange(event:ClipEvent):void {
var stageVideo:StageVideo = event.info as StageVideo;
log.info("stage video state changed " + stageVideo);
log.debug("stage video state changed " + stageVideo);
if ( stageVideo ) {
if (stageVideo) {
//#44 fixes for #627 check if the stagevideo dimensions and positioning has changed to update the stage video mask with.
//unbinding and binding stage video events caused issues with instream playlists therefore has to be kept binded.
if (_screenMask.width !== stageVideo.viewPort.width) {
_screenMask.width = stageVideo.viewPort.width;
}
_screenMask.width = stageVideo.viewPort.width;
_screenMask.height = stageVideo.viewPort.height;
_screenMask.x = stageVideo.viewPort.x;
_screenMask.y = stageVideo.viewPort.y;
if (_screenMask.height !== stageVideo.viewPort.height) {
_screenMask.height = stageVideo.viewPort.height;
}
if (_screenMask.x !== stageVideo.viewPort.x) _screenMask.x = stageVideo.viewPort.x;
if (_screenMask.y !== stageVideo.viewPort.y) _screenMask.y = stageVideo.viewPort.y;
log.debug("mask dimensions " + _screenMask.width + " x " + _screenMask.height);
log.debug("mask pos " + _screenMask.x + ", " + _screenMask.y);
if ( ! contains(_screenMask) ) {
//#508 stage video mask was being added to the top layer and hiding all children.
addChildAt(_screenMask, 0);
if (!contains(_screenMask)) {
//#508 stage video mask was being added to the top layer and hiding all children.
//_canvasLogo.visible = false;
//#20 for the free player swap the logo with the stage video mask to display underneath not on top.
CONFIG::freeVersion {
swapChildren(_screenMask, _canvasLogo);
addChildAt(_screenMask, 0);
swapChildren(_screenMask, _copyrightNotice);
swapChildren(_screenMask, _canvasLogo);
}
CONFIG::commercialVersion {
addChildAt(_screenMask, 1);
}
//addChildAt(_screenMask, _canvasLogo ? 1 : 0);
log.debug("adding mask");
}
//#627 unbind the stagevideo state change events after the screen mask is setup.
_flowplayer.playlist.unbind(onStageVideoStateChange);
} else {
if ( contains(_screenMask) ) {
if (contains(_screenMask)) {
log.debug("removing mask")
removeChild(_screenMask);
_flowplayer.playlist.unbind(onStageVideoStateChange);
}
}
}
/**
* #627 re-enable stagevideo state change listeners if stagevideo is available or detach the fullscreen events on first call.
* @param event
*/
private function onStageVideoFullscreen(event:PlayerEvent):void
{
//#627 if stage video is not configured or available unbind the fullscreen events on first try.
if (!_flowplayer.playlist.current.useStageVideo) {
_flowplayer.unbind(onStageVideoFullscreen);
}
_flowplayer.playlist.onStageVideoStateChange(onStageVideoStateChange);
}
}
private function createPanel():void {
......
......@@ -170,14 +170,17 @@ package org.flowplayer.view {
return;
var p:Point = localToGlobal(new Point(0, 0));
var r:Rectangle = _visible ? new Rectangle(p.x, p.y, width, height) : new Rectangle(0, 0, 0, 0);
_stageVideo.viewPort = r;
_clip.dispatch(ClipEventType.STAGE_VIDEO_STATE_CHANGE, stageVideo);
}
override public function set width(value:Number):void {
super.width = value;
_updateStageVideo();
}
override public function set height(value:Number):void {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment