| OLD | NEW |
| 1 var captionsButtonElement; | 1 var captionsButtonElement; |
| 2 var captionsButtonCoordinates; | 2 var captionsButtonCoordinates; |
| 3 | 3 |
| 4 // These reflect the values used to fade in/out the media controls. Should | 4 // These reflect the values used to fade in/out the media controls. Should |
| 5 // mirror the values 'fadeInDuration'/'fadeOutDuration' in MediaControlElements.
cpp. | 5 // mirror the values 'fadeInDuration'/'fadeOutDuration' in MediaControlElements.
cpp. |
| 6 const controlsFadeInDurationMs = 100; | 6 const controlsFadeInDurationMs = 100; |
| 7 const controlsFadeOutDurationMs = 300; | 7 const controlsFadeOutDurationMs = 300; |
| 8 | 8 |
| 9 // The timeout for the hide-after-no-mouse-movement behavior. Defined (and | 9 // The timeout for the hide-after-no-mouse-movement behavior. Defined (and |
| 10 // should mirror) the value 'timeWithoutMouseMovementBeforeHidingMediaControls' | 10 // should mirror) the value 'timeWithoutMouseMovementBeforeHidingMediaControls' |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 } | 113 } |
| 114 | 114 |
| 115 function clickCCButton() | 115 function clickCCButton() |
| 116 { | 116 { |
| 117 consoleWrite("*** Click the CC button."); | 117 consoleWrite("*** Click the CC button."); |
| 118 eventSender.mouseMoveTo(captionsButtonCoordinates[0], captionsButtonCoordina
tes[1]); | 118 eventSender.mouseMoveTo(captionsButtonCoordinates[0], captionsButtonCoordina
tes[1]); |
| 119 eventSender.mouseDown(); | 119 eventSender.mouseDown(); |
| 120 eventSender.mouseUp(); | 120 eventSender.mouseUp(); |
| 121 } | 121 } |
| 122 | 122 |
| 123 function runAfterControlsHidden(func, mediaElement) | 123 function runAfterHideMediaControlsTimerFired(func, mediaElement) |
| 124 { | 124 { |
| 125 if (mediaElement.paused) | 125 if (mediaElement.paused) |
| 126 throw "The media element is not playing"; | 126 throw "The media element is not playing"; |
| 127 | 127 |
| 128 // Compute the time it'll take until the controls will be invisible - | 128 // Compute the time it'll take until the controls will be invisible - |
| 129 // assuming playback has been started prior to invoking this | 129 // assuming playback has been started prior to invoking this |
| 130 // function. Allow 500ms slack. | 130 // function. Allow 500ms slack. |
| 131 var hideTimeoutMs = controlsMouseMovementTimeoutMs + controlsFadeOutDuration
Ms + 500; | 131 var hideTimeoutMs = controlsMouseMovementTimeoutMs + controlsFadeOutDuration
Ms + 500; |
| 132 | 132 |
| 133 if (!mediaElement.loop && hideTimeoutMs >= 1000 * (mediaElement.duration - m
ediaElement.currentTime)) | 133 if (!mediaElement.loop && hideTimeoutMs >= 1000 * (mediaElement.duration - m
ediaElement.currentTime)) |
| 134 throw "The media will end before the controls have been hidden"; | 134 throw "The media will end before the controls have been hidden"; |
| 135 | 135 |
| 136 setTimeout(func, hideTimeoutMs); | 136 setTimeout(func, hideTimeoutMs); |
| 137 } | 137 } |
| OLD | NEW |