From 6bbdae6f00ce69adf98f33f2ebb6e610ac27767a Mon Sep 17 00:00:00 2001 From: Ernie Park Date: Wed, 7 Mar 2012 02:21:21 -0500 Subject: [PATCH] update video_init to use global video_speed variable to cue up same speed and make sure active class added to corrct speed --HG-- branch : ernie-templates-video-fixes --- video_init.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/video_init.js b/video_init.js index 63b7f055f4..d38e47c073 100644 --- a/video_init.js +++ b/video_init.js @@ -29,15 +29,18 @@ function 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 +if (video_speed == 1 || !streams[video_speed]) { + loadNewVideo(streams["1.0"], streams["1.0"], ${ position }); +} else { + loadNewVideo(streams["1.0"], streams[video_speed], ${ position }); +} function add_speed(key, stream) { var id = 'speed_' + stream; - //TODO: this should be smarter and know which video is first selected when we have - // video speed as an option/parameter per user that is saved - if (key == 1.0) { + if (key == video_speed) { $("#video_speeds").append('
  • '+key+'x
  • '); } else { $("#video_speeds").append('
  • '+key+'x
  • ');