<?php
$base = urldecode(filter_var($_GET['mov'],FILTER_SANITIZE_STRING));
$movie_stem = preg_replace("/[^a-zA-Z0-9_ ]+/", "", $base);
?><!DOCTYPE html>
<!--suppress CommaExpressionJS -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Cartographica</title>

<style type="text/css">
<!--
body {
    margin: 0;
}

#video {
	text-align: center;
}
-->
</style></head>

<body>
<div id="video">
    <video width="320" height="480" controls>
        <source src="HLS/<?php echo $movie_stem; ?>/index.m3u8" type="application/x-mpegURL">
        <source src="full/<?php echo $movie_stem; ?>.mp4" type="video/mp4">
        Your browser does not support the video tag.
    </video>
</div>

</body>
<!-- Google Analytics -->
<script type="text/javascript">
    (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
            (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
        m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
    })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

    ga('create', 'UA-331159-9', 'auto', {'allowLinker': true});  // Replace with your property ID.
    ga('require', 'linker');
    ga('linker:autoLink', ['store.macgis.com']);      // Domains that are linked from this page.
    ga('send', 'pageview');

    ga('send', 'event', 'Screencasts', 'Load', '<?php echo filter_var($_GET['mov'],FILTER_SANITIZE_STRING);  ?>');
    }
</script>
</html>
