Script Summary: *** Outdated, hörsport itself now provides similiar syncing with videos *** This script automatically selects the exercise in the exercise list relative to the current position of the workout player. With this script, the explanatory images can be viewed more easily while performing the exercise.
Version: 0.13
License: Public Domain
*** Outdated as of 5th of April 2012 ***
*** hörsport itself now provides similar syncing with videos ***
Version information
Currently tested with Greasemonkey 0.9.13/Firefox 9.0.1 and Greasemonkey 0.9.17/Firefox 10.0.1. Depends heavily on the current content management system (CMS) of hörsport (hoersport.de); in effect, any changes to this CMS may render this script complete unusable.
Configuration
To enable/disable the scrolling behavior or change the sync interval, edit your locally installed script by selecting Tools > Add-ons in the Firefox menu. Then, open the User scripts tab and click on the Preferences button of this script. Afterwards, click on the Edit this User script button and modify the scrollToExerciseListOnPlay / syncPlayerAndExerciseListInterval variables at the top of the script to the appropriate value.
Features
_ Keeps the current position of the workout player in sync with the selected exercise in the exercise list.
_ When clicking an exercise in the exercise list, jumps to the position of the exercise in the workout player.
_ Automatically scrolls the exercise list to the center of the screen when the Play button is pressed.
_ Completely expands the exercise list; no collapsed categories anymore.
Known shortcomings and bugs
_ Exercise->position sync: When clicking an exercise in the exercise list, the wrong exercise title may be displayed in the player if it is paused; however, the player still seeks to the right position. This behavior does not occur when clicking the exercise during play.
_ Exercise->position sync: The position to seek to has to be already preloaded in the workout player; this is a limitation of the used SoundManager2 JavaScript library and will not be fixed on my behalf.
_ Find a better sync method than retrieving the time every half second; possibly, the workout player widget has some hook/callback facility on chapter/exercise change.
_ JQuery/JavaScript needs optimization.
Ideas
_ Retrieve the textual explanation via AJAX and display the text under the explanatory images.
Changelog
-- 2012-01-17 v0.13 --
_ Fix: Start sync timer right away; previous click on Play button not needed anymore.
_ Feature: Also sync the other way around, i.e. when clicking on an exercise in the exercise list, the workout player seeks to the right position. This introduces the shortcoming that the position to seek to has to be already preloaded in the workout player, and the shortcoming that the workout player may not display the right exercise title in paused mode.
_ Feature: Decrease default sync interval to 0.5s.
-- 2012-01-15 v0.12 --
Third alpha version.
_ Fix: Properly switch the carousel item containing the explanatory images for an exercise. This fixes the problem of only one image being displayed per exercise.
_ Fix: Revert to detection of workout and feedback pages at JavaScript/JQuery level, because the workout or feedback page can be displayed at the same URL after a new login to the hörsport website.
_ Feature: Add some documentation to the script.
-- 2012-01-15 v0.11 --
Second alpha version.
_ Feature: Let user enable/disable scroll feature via local edit.
_ Feature: Let user configure sync interval via local edit.
_ Feature: Also sync player and exercise list when player is paused (new shortcoming: Play button has to be pressed once to start the sync timer).
_ Fix: Improve @include directive, so script only runs on workout page; make sure to @exclude feedback page, because the script breaks the exercise list in detailed feedback mode.
_ Fix: Set created Date instances to fixed date to keep sync when day changes during workout.
--- 2012-01-14 v0.1 ---
First alpha version.



