integration/content.html
changeset 57 b7017da5a7b5
parent 50 9cc1b66d0880
child 58 00632d0dee47
--- a/integration/content.html	Wed Dec 19 16:55:00 2012 +0100
+++ b/integration/content.html	Mon Dec 17 18:19:36 2012 +0100
@@ -26,10 +26,29 @@
                 post_annotation : "testdata/post-test.php",
                 tag_page : "tag.html?tag=__TAG__"
             };
+            if (typeof window.localStorage !== "undefined" && window.localStorage.getItem !== "undefined") {
+                var res = window.localStorage.getItem("resolution") || "SD";
+            } else {
+                var res = "SD";
+            }
+            IriSP.video_url_transform = function(url) {
+                return url.replace(/([SH]D)\.[a-z0-9]+$/,res);
+            }
             $(function() {
                 IriSP.contentplayer({
                     project_url: "http://theend-integ.ftinfo.fr/theend/ldt/cljson/id/" + project
                 });
+                
+                $(".sdhdgroup").addClass(res);
+                
+                $(".sdhdbtn").click(function() {
+                    var newres = $(this).attr("title");
+                    if (res !== newres) {
+                        window.localStorage.setItem("resolution", newres);
+                        document.location.reload();
+                    }
+                    return false;
+                });
             });
         </script>
 
@@ -77,7 +96,11 @@
                 <div class="container_hcentering">
                     <a id="btnInfo" class="btn" href="#" title="info"></a>
 
-                    <a id="btnSDHD" class="btn" href="#" title="SD/HD"></a>
+                    <div class="sdhdgroup">
+                        <a id="btnSD" class="sdhdbtn" href="#" title="SD"></a>
+                        <div class="sdhdbtn sdhdsep"></div>
+                        <a id="btnHD" class="sdhdbtn" href="#" title="HD"></a>
+                    </div>
 
                     <div id="progressContainer" class="floatL">