var MediaViewItemVideo = new Class({
    Extends: MediaViewItem,

    url: null,
    swfObject: null,

    initialize: function(mediaView,url){
        this.parent(mediaView);
        this.url = url;

        this.element.addClass("MediaViewItemVideo");

        this.swfObject = new Swiff('swf/player.swf',{
            width: "100%",
            height: "100%",
            container: this.element,
            params: {
                wMode: 'opaque',
                allowFullScreen: "true",
                allowscriptaccess: "always"
            },
            vars: {
                movieurl: this.url
            }
        });
    },
    onResize: function(disableAnimation){
        if( this.parent() == false )
        {
            return;
        }
    },
    show: function(){
        this.parent();

        this.mediaView.colorOverlay.setStyle("display","none");
        this.onResize();
    },
    hide: function(){
        this.mediaView.colorOverlay.setStyle("display","block");

        this.parent();
    },
    onResize: function(disableAnimation){
        if( this.parent() == false )
        {
            return;
        }
        if( this.swfObject != null )
        {
            this.element.set("width",this.currentWidth);
            this.element.set("height",this.currentHeight);
        }
    }
});

function onMediaViewItemVideoPlay()
{
    MediaView.pauseInstances();
}

function onMediaViewItemVideoPause()
{
    MediaView.playInstances();
}
