Commit 6cbc7c9e by Piotr Mitros

Merge

parents 318a9f2b 39c728cb
...@@ -84,6 +84,7 @@ ...@@ -84,6 +84,7 @@
<script type="text/javascript" src="${ settings.LIB_URL }jquery.treeview.js"></script> <script type="text/javascript" src="${ settings.LIB_URL }jquery.treeview.js"></script>
<script type="text/javascript" src="/static/js/jquery.leanModal.min.js"></script> <script type="text/javascript" src="/static/js/jquery.leanModal.min.js"></script>
<script type="text/javascript" src="/static/js/jquery.cookie.js"></script>
<script type="text/javascript" src="/static/js/video_player.js"></script> <script type="text/javascript" src="/static/js/video_player.js"></script>
<script type="text/javascript" src="/static/js/schematic.js"></script> <script type="text/javascript" src="/static/js/schematic.js"></script>
<script type="text/javascript" src="/static/js/cktsim.js"></script> <script type="text/javascript" src="/static/js/cktsim.js"></script>
......
...@@ -30,14 +30,13 @@ function good() { ...@@ -30,14 +30,13 @@ function good() {
ajax_video=good; ajax_video=good;
loadNewVideo(streams["1.0"], ${ position }); // load the same video speed your last video was at in a sequence
// if the last speed played on video doesn't exist on another video just use 1.0 as default
function add_speed(key, stream) { function add_speed(key, stream) {
var id = 'speed_' + stream; var id = 'speed_' + stream;
//TODO: this should be smarter and know which video is first selected when we have if (key == video_speed) {
// video speed as an option/parameter per user that is saved
if (key == 1.0) {
$("#video_speeds").append(' <li class=active id="'+id+'">'+key+'x</li>'); $("#video_speeds").append(' <li class=active id="'+id+'">'+key+'x</li>');
} else { } else {
$("#video_speeds").append(' <li id="'+id+'">'+key+'x</li>'); $("#video_speeds").append(' <li id="'+id+'">'+key+'x</li>');
...@@ -64,9 +63,24 @@ function sort_by_value(a,b) { ...@@ -64,9 +63,24 @@ function sort_by_value(a,b) {
l.sort(sort_by_value); l.sort(sort_by_value);
for(var i=0; i<l.length; i++) { $(document).ready(function() {
add_speed(l[i], streams[l[i]]) video_speed = $.cookie("video_speed");
} console.log("ready");
console.log(video_speed);
if (( !video_speed ) || ( !streams[video_speed] )) {
video_speed = "1.0";
}
console.log(video_speed);
loadNewVideo(streams["1.0"], streams[video_speed], ${ position });
for(var i=0; i<l.length; i++) {
add_speed(l[i], streams[l[i]])
}
});
function toggleVideo(){ function toggleVideo(){
if ($("#video_control").hasClass("play")){ if ($("#video_control").hasClass("play")){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment