If you can afford to play the video and just pause it at the end, you can just pause it 100 ms before the end and it won't blink. But if you want to loop it, then it will blink and haven't found a workaround for that.
Also, if you play the video and you dispose it upon playback complete, it will just disappear normally and no blinks.
I want to use hardware acceleration, I don't want to sacrifice performance.
The problem is that when we issue pause it might take more than 100 ms, video finishes and blink happens anyway. Sometimes you might have to stop 1 second before, depending on the video. I found a good compromise at totalTime/fps*2, but I think it's all unreliable, who knows how it goes on another machine, different devices.
sounds like a mess...
code:
private function onCurrentTimeChange(e:Event):void
{
trace(currentTime + " of " + totalTime);
if(currentTime > totalTime - totalTime/fps*2)
{
if(_loop)
{
seek(0);
play();
}
else
{
removeEventListener(MediaPlayerEventType.CURRENT_TIME_CHANGE, onCurrentTimeChange);
pause();
trace("pause!");
trace("time " + currentTime);
}
}
}
private function ready(e:Event):void
{
_imageLoader.source = texture;
if(width && height)
setSize(width, height);
else
setSize(texture.width, texture.height);
if(!_disposeOnComplete)
addEventListener(MediaPlayerEventType.CURRENT_TIME_CHANGE, onCurrentTimeChange);
}
private function playBackComplete(e:Event):void
{
log("Video playback completed: " + videoSource);
if(_disposeOnComplete)
removeFromParent(true);
}