diff -r 285f51fd2480 -r b7017da5a7b5 integration/tag.html --- a/integration/tag.html Wed Dec 19 16:55:00 2012 +0100 +++ b/integration/tag.html Mon Dec 17 18:19:36 2012 +0100 @@ -27,12 +27,32 @@ post_annotation : "testdata/post-test.php", tag_page : "niv2_rv.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() { $("h1").text(tag); + IriSP.tagplayer({ tag : tag }); + + $(".sdhdgroup").addClass(res); + + $(".sdhdbtn").click(function() { + var newres = $(this).attr("title"); + if (res !== newres) { + window.localStorage.setItem("resolution", newres); + document.location.reload(); + } + return false; + }); }); @@ -80,7 +100,11 @@