OLD | NEW |
1 var captionsButtonElement; | 1 var captionsButtonElement; |
2 var captionsButtonCoordinates; | 2 var captionsButtonCoordinates; |
3 | 3 |
4 // As specified in mediaControls.css, this is how long it takes to fade out cont
rols | 4 // As specified in mediaControls.css, this is how long it takes to fade out cont
rols |
5 const controlsFadeOutDurationMs = 300; | 5 const controlsFadeOutDurationMs = 300; |
6 | 6 |
7 // The timeout for the hide-after-no-mouse-movement behavior. Defined (and | 7 // The timeout for the hide-after-no-mouse-movement behavior. Defined (and |
8 // should mirror) the value 'timeWithoutMouseMovementBeforeHidingMediaControls' | 8 // should mirror) the value 'timeWithoutMouseMovementBeforeHidingMediaControls' |
9 // in MediaControls.cpp. | 9 // in MediaControls.cpp. |
10 const controlsMouseMovementTimeoutMs = 3000; | 10 const controlsMouseMovementTimeoutMs = 3000; |
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
218 // Compute the time it'll take until the controls will be invisible - | 218 // Compute the time it'll take until the controls will be invisible - |
219 // assuming playback has been started prior to invoking this | 219 // assuming playback has been started prior to invoking this |
220 // function. Allow 500ms slack. | 220 // function. Allow 500ms slack. |
221 var hideTimeoutMs = controlsMouseMovementTimeoutMs + controlsFadeOutDuration
Ms + 500; | 221 var hideTimeoutMs = controlsMouseMovementTimeoutMs + controlsFadeOutDuration
Ms + 500; |
222 | 222 |
223 if (!mediaElement.loop && hideTimeoutMs >= 1000 * (mediaElement.duration - m
ediaElement.currentTime)) | 223 if (!mediaElement.loop && hideTimeoutMs >= 1000 * (mediaElement.duration - m
ediaElement.currentTime)) |
224 throw "The media will end before the controls have been hidden"; | 224 throw "The media will end before the controls have been hidden"; |
225 | 225 |
226 setTimeout(func, hideTimeoutMs); | 226 setTimeout(func, hideTimeoutMs); |
227 } | 227 } |
| 228 |
| 229 function hasFullscreenButton(element) |
| 230 { |
| 231 var size = mediaControlsButtonDimensions(element, "fullscreen-button"); |
| 232 return size[0] > 0 && size[1] > 0; |
| 233 } |
OLD | NEW |