{% set newTitle = text_title|replace({'{title}': title, '{siteName}': siteName}) %}
{% set minify = productionMode ? '.min' : '' %}
{% set preconnectURL = baseURL|replace({'https:': '', 'http:': ''}) %}
<!DOCTYPE html>
<html lang="{{ lang }}">

	<head>
		<meta charset="utf-8">
		<base href="{{ baseURL }}">
    	<meta http-equiv="X-UA-Compatible" content="IE=edge">
		<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
		{% if isSSL %}
			<meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
		{% endif %}
		{% if isSafariIE == false %}
			{% set referer = isDirectHost ? 'no-referrer' : 'same-origin' %}
			<meta name="referrer" content="{{ referer }}">
		{% endif %}
		<meta name="robots" content="noindex">
		<meta name="googlebot" content="noindex">
		<meta name="description" content="{{ newTitle }}">
		<meta name="og:sitename" content="{{ siteName }}">
		<meta name="og:title" content='{{ title }}'>
		<meta name="og:description" content="{{ newTitle }}">
		<meta name="og:type" content="video.movie">
		<meta name="og:image" content="{{ poster }}">
		<meta name="twitter:card" content="summary_large_image">
		<meta name="twitter:title" content='{{ title }}'>
		<meta name="twitter:description" content="{{ newTitle }}">
		<meta name="twitter:image" content="{{ poster }}">
		<meta name="msapplication-TileColor" content="{{ themeColor }}">
		<meta name="theme-color" content="{{ themeColor }}">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<title>{{ newTitle }}</title>
		<link rel="manifest" href="manifest.webmanifest">
		<link rel="mask-icon" href="assets/img/maskable_icon.png" color="#ffffff">
		<link rel="shortcut icon" href="favicon.ico" type="image/ico">
		<link rel="preconnect" href="{{ preconnectURL }}">
		<link rel="preconnect" href="//cdn.jsdelivr.net">
		<link rel="preconnect" href="//www.gstatic.com">
		<link rel="preconnect" href="//www.googleapis.com">
		<link rel="preconnect" href="//www.googletagmanager.com">
		<link rel="preconnect" href="//www.google.com">
		<link rel="preconnect" href="//www.google-analytics.com">
		<link rel="preconnect" href="//fonts.gstatic.com">
		<link rel="preconnect" href="//googleusercontent.com">
		<link rel="preconnect" href="//lh3.googleusercontent.com">
		<link rel="preconnect" href="//drive-thirdparty.googleusercontent.com">
		<link rel="dns-prefetch" href="{{ preconnectURL }}">
		<link rel="dns-prefetch" href="//cdn.jsdelivr.net">
		<link rel="dns-prefetch" href="//www.gstatic.com">
		<link rel="dns-prefetch" href="//www.googleapis.com">
		<link rel="dns-prefetch" href="//www.googletagmanager.com">
		<link rel="dns-prefetch" href="//www.google.com">
		<link rel="dns-prefetch" href="//www.google-analytics.com">
		<link rel="dns-prefetch" href="//fonts.gstatic.com">
		<link rel="dns-prefetch" href="//googleusercontent.com">
		<link rel="dns-prefetch" href="//lh3.googleusercontent.com">
		<link rel="dns-prefetch" href="//drive-thirdparty.googleusercontent.com">
		<link rel="stylesheet" type="text/css" href="assets/css/player-v3.1{{ minify }}.css">
		<style>
			.lds-ellipsis div,
			#btnServer,
			#servers li a:hover,#servers li a:focus,#servers li a.active {
				background-color: {{ playerColor }} !important
			}
			#btnServer {
				border-color: {{ playerColor }} !important
			}
		</style>
		{{ GA }}
		{{ GTM_Head }}
		<script type="text/javascript" src="https://polyfill.io/v3/polyfill{{ minify }}.js"></script>
		<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/jquery/dist/jquery{{ minify }}.js"></script>
		<script type="text/javascript" src="assets/js/app-v3.js"></script>
		<script type="text/javascript">
			var canRunAds = true, playerConfig = {{ playerConfig }};
			window.canRunAds = canRunAds;
		</script>
	</head>

	<body>
		{{ GTM_Body }}
		<div id="mContainer" class="embed-container">
			<div class="embed-wrapper">
				<div id="loading" class="lds-ellipsis">
					<div></div>
					<div></div>
					<div></div>
				</div>
				<h1 id="message">{{ message }}</h1>
			</div>
		</div>
		{% if isError == false %}
			<div id="videoContainer" style="display:none"></div>
			{% if servers|length > 1 %}
				<div id="server-list" style="{{ randomSource ? 'display:none' : '' }}">
					<button type="button" id="btnServer" onclick="$('#servers').toggle()">
						<img src="assets/img/menu.png" alt="Servers">
					</button>
					<ul id="servers" style="display:none">
						{% for i, val in servers %}
							<li>
								<a href="{{ val.url }}" class="{{ val.active ? 'active' : '' }}">
									{% if hideHostname == false %}
										<img src="assets/img/logo/{{ val.host }}.png" alt="{{ val.name }}" width="16" height="16"/>&nbsp;
									{% endif %}
									{{ val.name }}
								</a>
							</li>
						{% endfor %}
					</ul>
				</div>
			{% endif %}
			<div id="resume" style="display:none">
				<div class="pop-wrap">
					<div class="pop-main">
						<div class="pop-html">
							<div class="pop-block">
								<div class="myConfirm">
									<p>{{ text_resume }}</p>
									<p>
										<button type="button" id="resume_no" class="button" onclick="$('#resume').hide()">{{ text_resume_no }}</button>
										<button type="button" id="resume_yes" class="button" onclick="jwp.resumePlayback()">{{ text_resume_yes }}</button>
									</p>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
			<div id="directAds" style="display:none">
				<button id="closeAds" type="button" onclick="$('#directAds').hide();$('#iframeAds').attr('src', '')" title="{{ text_close_ads }}" aria-label="{{ text_close_ads }}">&times;</button>
				<iframe id="iframeAds" title="Ads" style="border:0" width="100%" height="100%"></iframe>
			</div>
			{% if enableP2P and isIE == false %}
				<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p2p-media-loader-core/build/p2p-media-loader-core{{ minify }}.js"></script>
				<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/p2p-media-loader-hlsjs/build/p2p-media-loader-hlsjs{{ minify }}.js"></script>
				<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/hls.js@0.14.17/dist/hls{{ minify }}.js"></script>
				<script type="text/javascript" src="assets/vendor/jwplayer/jwplayer.{{ playerVersion }}.js"></script>
				<script type="text/javascript" src="https://cdn.jsdelivr.net/npm/@hola.org/jwplayer-hlsjs/dist/jwplayer.hlsjs{{ minify }}.js"></script>
			{% else %}
				<script type="text/javascript" src="assets/vendor/jwplayer/jwplayer.{{ playerVersion }}.js"></script>
			{% endif %}
			<script type="text/javascript" src="assets/js/player-v3.4{{ minify }}.js"></script>
		{% endif %}
		<script type="text/javascript">
			if ("serviceWorker" in navigator) {
				navigator.serviceWorker
					.register('sw.js')
					.then(function(res) {
						console.debug("service worker registered");
					})
					.catch(function(err) {
						console.debug("service worker not registered", err);
					});
			}
		</script>
		{{ Histats }}
		{{ PopupAds }}
	</body>

</html>
