').appendTo('#top-an-pics');
if (flashURL) {
if (flashAvailable()) {
container.append(getFlashCode(8, flashURL, altMaketURL, altMaketLink, "100%", "90px"));
} else if (altMaketURL) {
container.append('
');
}
} else if(htmlBanner){
container.append($(htmlBanner));
} else if (videoBannerURL) {
var createHTML5UppodPlayer = function (options) {
var videoElement = document.getElementById(options.uid),
htmlPlayer = new Uppod({
m: 'video',
st: options.st,
uid: options.uid,
file: options.file,
poster: options.poster,
iosplayer: options.iosplayer
});
// В случае ошибки останавливаем воспроизведение
videoElement.addEventListener('error', function (e) {
e.stopPropagation();
htmlPlayer.Stop();
}, false);
return htmlPlayer;
};
var handler = function (e) {
e.preventDefault();
var uAgent = navigator.userAgent.toLowerCase(),
isMobileIOS = uAgent.indexOf('iphone') !== -1 || uAgent.indexOf('ipad') !== -1,
isSupportVideoTag = !!document.createElement('video').canPlayType,
isAvailableFlash = flashAvailable(),
options = {
version: 8,
player: '/flash/uppod.swf',
width: flashVideoWidth,
height: flashVideoHeight,
warning: 'Для просмотра видеоролика необходимо установить flash-плеер версии не ниже 8.',
uid: 'banners_top_player',
file: videoFile,
poster: flashVideoPoster,
st: !isMobileIOS ? 'uppodvideo' : '',
iosplayer: isMobileIOS ? 1 : 0,
properties: {
flashvars: flashVideoVars,
allowFullScreen: 'true'
}
},
popupId = 'banners_top_video',
$popup = $('#' + popupId),
$videoContainer = $('#' + options.uid),
player;
if (isSupportVideoTag) {
// player = Uppod
player = createHTML5UppodPlayer(options);
setTimeout(function () { player.Play(); }, 1);
} else if (isAvailableFlash) {
// player = $(