web/client.php
changeset 940 843f96e4eebd
parent 926 6c5b07e9ecdc
child 976 d3c6e4ae0d50
--- a/web/client.php	Thu Jul 11 15:30:43 2013 +0200
+++ b/web/client.php	Tue Jul 23 13:14:21 2013 +0200
@@ -289,41 +289,36 @@
                 </ul>
                 <div class="ifwrap" id="vlWrap">
                     <div id="videoLivePlayer">
-                    <?php if (isset($config['islive']) && $config['islive']):?>
-                        <object id="player" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" name="player" width="<?php echo $videoWidth; ?>" height="<?php echo $videoHeight; ?>">
-                            <param name="movie" value="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf" />
-                            <param name="allowfullscreen" value="true" />
-                            <param name="allowscriptaccess" value="always" />
-                            <param name="wmode" value="transparent" />
-                            <?php
-
-function flv_param($name,$default) {
-    global $config;
-    return ( isset($config["flv_$name"]) ? ( $config["flv_$name"] ? "&$name=".$config["flv_$name"] : "" ) : "&$name=$default" );
-}
-
-$flashvars = "autostart=true&live=true".flv_param("provider", "rtmp").flv_param("streamer", "rtmp://media.iri.centrepompidou.fr/ddc_player/").flv_param("file", "livestream")."&image=$big_visual_url&controlbar=none&autostart=true";
-                            ?>
-                            <param name="flashvars" value="<?php echo $flashvars; ?>" />
-                            <embed
-                                type="application/x-shockwave-flash"
-                                id="player2"
-                                name="player2"
-                                src="<?php echo(URL_ROOT); ?>res/mediaplayer/player.swf"
-                                width="<?php echo $videoWidth; ?>"
-                                height="<?php echo $videoHeight; ?>"
-                                allowscriptaccess="always"
-                                allowfullscreen="true"
-                                wmode="transparent"
-                                flashvars="<?php echo $flashvars; ?>"
-                            />
-                        </object>
-                    <?php elseif(isset($config['islive_embed']) && $config['islive_embed']):?>
+                    <?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); ?>" />
                     <?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
+        );
+?>
+
+                    <script type="text/javascript" src="<?php echo(registry_url('jwplayer-js','js'))?>"></script>
+                    <script type="text/javascript">
+                        jwplayer('videoLivePlayer').setup(<?php echo json_encode($jwpconfig); ?>);
+                    </script>
+<?php
+    }
+?>
+                
                 </div>
                 <div class="ifwrap hidden" id="iframeWrap">
                     <iframe id="graphFrame"></iframe>