web/client.php
changeset 1368 0ae5202742bd
parent 1366 2cebaaf18c54
child 1370 d9711e6b1f17
--- a/web/client.php	Fri Dec 09 19:00:18 2016 +0100
+++ b/web/client.php	Mon Dec 12 01:54:10 2016 +0100
@@ -69,6 +69,7 @@
     <!-- CSS -->
     <link rel="stylesheet" href="<?php echo(registry_url('fancybox','css'));?>" type="text/css" media="screen">
     <link rel="stylesheet" href="<?php echo(registry_url('tweetcast','css'));?>?v=210512" type="text/css" media="screen, projection"/>
+    <link href="<?php echo(registry_url('videojs','css'));?>" rel="stylesheet"-->
 
     <link href='<?php echo(URL_ROOT); ?>res/css/common.css' rel='stylesheet' type='text/css'/>
 
@@ -83,6 +84,13 @@
     <script type="text/javascript" src="<?php echo(registry_url('raphael','js'))?>"></script>
     <script type="text/javascript" src="<?php echo(registry_url('fancybox','js'))?>"></script>
 
+    <style>
+    video {
+       width: 480px;
+       height: 320px;
+    }
+    </style>
+
     <script type="text/javascript">
         <?php
         if (isset($config['tracking_keywords']) && count($config['tracking_keywords'])) {
@@ -279,28 +287,23 @@
                     <?php if(isset($config['islive_embed']) && $config['islive_embed']):?>
                         <?php echo str_replace(array('{{width}}','{{height}}'), array($videoWidth, $videoHeight), $translate->_('config__islive_embed')); ?>
                     <?php else: ?>
-                        <img class="live-thumbnail" src="<?php echo($big_visual_url); ?>" />
+                        <video id="videoPlayer" width=<?php echo($videoWidth); ?> height=<?php echo($videoHeight); ?> autoplay controls poster="<?php echo($big_visual_url); ?>" class="video-js vjs-default-skin"><img class="live-thumbnail" src="<?php echo($big_visual_url); ?>" /></video>
                     <?php endif; ?>
                     </div>
 <?php
     if (isset($config['islive']) && $config['islive']) {
         $videofile = $translate->_('config__video_file');
-        if ($videofile == 'config__video_file') $videofile = "rtmp://media.iri.centrepompidou.fr/ddc_player/livestream";
-        $jwpconfig = array(
-            "width" => $videoWidth,
-            "height" => $videoHeight,
-            "file" => $videofile,
-            "image" => $big_visual_url,
-            "primary" => "flash",
-            "flashplayer" => URL_ROOT."res/mediaplayer/player.swf",
-            "fallback" => false,
-            "autostart" => true
-        );
+        if ($videofile == 'config__video_file') $videofile = "https://media.iri.centrepompidou.fr/dash/livestream.mpd";
 ?>
 
-                    <script type="text/javascript" src="<?php echo(registry_url('jwplayer-js','js'))?>"></script>
+                    <script type="text/javascript" src="<?php echo(registry_url('dashjs','js'))?>"></script>
+
                     <script type="text/javascript">
-                        jwplayer('videoLivePlayer').setup(<?php echo json_encode($jwpconfig); ?>);
+                        (function(){
+                            var url = "<?php echo($videofile)?>";
+                            var player = dashjs.MediaPlayer().create();
+                            player.initialize(document.querySelector("#videoPlayer"), url, true);
+                        })();
                     </script>
 <?php
     }