function isFlashPlayerInstalled()
{
    if (typeof deconcept=="undefined")
        return false;
    var version = deconcept.SWFObjectUtil.getPlayerVersion();
    if (version['major'] > 0)
        return true;
    else
        return false;
}
function isSupportHTML5Video() {
    return !!document.createElement('video').canPlayType;
}

function canPlayMp4()
{
    var v = document.createElement("video");
    return v.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"');
}
function canPlayOgg()
{
    var v = document.createElement("video");
    return v.canPlayType('video/ogg; codecs="theora, vorbis"');
}
function canPlayWebm()
{
    var v = document.createElement("video");
    return v.canPlayType('video/webm; codecs="vp8, vorbis"');
}
function supportVideoFormat(src)
{
    if (src.indexOf('.ogg') > 0)
    {
        return canPlayOgg();
    }
    if (src.indexOf('.mp4') > 0)
    {
        return canPlayMp4();
    }
    if (src.indexOf('.webm') > 0)
    {
        return canPlayWebm();
    }
}

function insertVideo(flashSrc, videoSrc, width, height)
{
    if (isFlashPlayerInstalled())
    {
        var s = '<object width="'+width+'" height="'+height+'"><param name="movie" value="'+flashSrc+'"></param><embed src="'+flashSrc+'" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'" ></embed></object>';
        document.write(s);
    }
    else if (isSupportHTML5Video() && supportVideoFormat(videoSrc))
    {
        var s = '<video src="'+videoSrc+'" controls></video>';
        document.write(s);
    }
    else
    {
        jQuery(function(){
            jQuery('#noFlash').show();
        });
    }
}

// нужна проверка поддерживаемого формата видео для html5
// http://htmlbook.ru/html5/detect#videoformat
