Commit graph

244 commits

Author SHA1 Message Date
138138138 ddd7f3f384
Update player.js 2021-02-03 11:50:14 +08:00
138138138 a6970e02f9
Fix double duration on all Apple devices
The fix will be applied when Safari browser is detected.
2021-02-02 21:25:13 +08:00
138138138 685902adab
Update player.js
Fixes audio mode duration doubled in iPhone iOS browsers. The player will stop after reaching the real duration. 
iOS() checks both iOS and iPadOS. 
Only tested on iPhone iOS browsers. Testers needed for behavior of iPadOS and MacOS.
2021-02-01 15:59:27 +08:00
Andrew Zhao 4a0b10984a Bump videojs and fix webworker 2021-01-29 19:08:28 -05:00
TheFrenchGhosty 1ad4685bb7
Merge pull request #1629 from tenpura-shrimp/searchui
Add ui for search sort and filter
2021-01-20 12:56:41 +00:00
Andrew Zhao 15ba3325d9 add ui for searching 2021-01-17 14:33:49 -05:00
Andre Borie 3046350cb2 Fix DASH playback bug. 2021-01-17 14:59:18 +00:00
Perflyst c7e65ce795
Merge pull request #1619 from tenpura-shrimp/ignorevideoplayback
do not add local to xhr when in videoplayback
2021-01-13 10:01:03 +01:00
Andrew Zhao 5a08dfa72f fix incorrect use of setinterval in js 2021-01-10 17:05:08 -05:00
Andrew Zhao ac0ed14eae do not add local to xhr when in videoplayback 2020-12-29 17:58:24 -05:00
Perflyst eeeecf9763
Merge pull request #1572 from saltycrys/add-dash-quality-preference
Add DASH quality preference
2020-12-23 20:36:13 +01:00
saltycrys 75c6844b66 Improve storyboards
Instead of limiting the width of storyboards through CSS it is now done in the
VTT directly.
2020-12-21 17:02:36 +01:00
saltycrys eed78c960d Improve DASH quality preference
Besides `auto`, `best` and `worst` it is now possible to select a target height.
If the target height is not available the closest lower height is selected.
2020-12-19 18:37:41 +01:00
saltycrys eea7ca9b72 Add DASH quality preference
The options are `auto` (the current and default behavior), `best` and `worst`.

The UI is only updated once playback starts.
2020-12-19 18:37:30 +01:00
saltycrys fc67dd18d0 Increase color contrast of light theme links 2020-12-14 14:20:31 +01:00
saltycrys b3e9b92344 Fix pure-button hover color on a-tags 2020-12-14 14:15:03 +01:00
TheFrenchGhosty 5e8856e65b
Merge pull request #1551 from saltycrys/add-embed-link
Add embed link to watch page
2020-12-08 21:30:13 +00:00
Andrew Zhao 0cb442d40e do not proxy hls on supported browser 2020-12-08 00:53:48 -05:00
saltycrys 680dc1f962 Shuffle URL params
The `list` and `index` params are the most important and come first now.
2020-12-08 02:30:48 +01:00
TheFrenchGhosty fe73eccb90
Merge pull request #1479 from saltycrys/theme-flash
Apply dark theme immediately
2020-11-28 20:54:45 +00:00
saltycrys 5f932e9749 Fix CSS specificity issues 2020-11-18 00:10:32 +01:00
saltycrys ff46c18164 Move themes into default.css
Now that themes are controlled with a class instead of setting
media="none" on the stylesheet link and both themes already being
duplicated in default.css for the automatic themeing it makes sense
to have all theme related CSS in the same place.

This commit also fixes the missing dark theme on embeds.
2020-11-17 22:53:45 +01:00
saltycrys de777907f2 Apply dark theme immediately
Themes are now controlled with a class on the body element.

If a preference is set the body element will have either "dark-theme"
or "light-theme" class. If no preference is set or the preference is
empty the class will be "no-theme".

"dark-theme" and "light-theme" are handled by darktheme.css and
lighttheme.css respectively.

"no-theme" is handled by default.css where depending on the value of
"prefers-color-scheme" the styles corresponding to "dark-theme" or
"light-theme" are applied.

Unfortunately this means that both themes are duplicated, once in the
theme .css and once in default.css.
2020-11-16 04:19:41 +01:00
saltycrys 0530045536
Remove double empty line 2020-11-12 16:53:31 +01:00
saltycrys d3e4739745 Improve storyboard display 2020-11-08 22:23:24 +01:00
saltycrys 3379f3ef61 Update videojs-vtt-thumbnails to latest upstream version
Note that the latest version on NPM is over two years old so this was built from source.
2020-11-08 22:02:25 +01:00
Matthew McGarvey 5937e0289e Fix feed menu overlap at ipad screen widths 2020-10-07 23:01:18 -05:00
TheFrenchGhosty 3ab3a5a236
Merge pull request #713 from leonklingele/keydown-mediakeys-detection
js: add support to detect media keys in keydown handler
2020-09-09 03:15:21 +00:00
Omar Roth 3f97bebd69
Support adding video to playlist from watch page 2020-04-09 10:55:32 -05:00
Omar Roth 0e58d99f4e Fix player mouseover events 2020-03-27 09:47:46 -05:00
Omar Roth bd7950b757
Add toggle_parent to dynamic handlers 2020-03-15 18:52:49 -04:00
leonklingele 70cbe91776
Migrate to a good Content Security Policy (#1023)
So attacks such as XSS (see [0]) will no longer be of an issue.

[0]: https://github.com/omarroth/invidious/issues/1022
2020-03-15 16:46:08 -05:00
Kyle Copperfield a3045a3953
Use a MediaQueryListener to toggle on demand. Tested on OSX. (#925)
Closes #867.
2020-03-02 09:33:47 -06:00
Leon Klingele e3593fe197
js: add support to detect media keys in keydown handler
See [0] for all the relevant codes.

[0]: https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/key/Key_Values#Multimedia_keys

Fixes a regression introduced in e6b4e12689.
Fixes https://github.com/omarroth/invidious/issues/712.
2020-03-01 17:43:19 +01:00
Jorge Maldonado Ventura dd9f1024f4 Remove invalid HTML from embed player 2020-02-01 19:25:03 +01:00
Omar Roth 72bfdfd925
Merge pull request #975 from jorgesumle/embed
Change embed code
2020-02-01 11:11:12 -05:00
Omar Roth 0560d2cfb7
Bump video.js 2020-01-08 20:19:47 -05:00
Jorge Maldonado Ventura 58c1a68ad9 Change embed code 2020-01-04 15:27:45 +01:00
Omar Roth 23ccaea2ff
Fix comment event listener 2019-10-18 12:44:11 -04:00
Omar Roth be055d9dcb
Add support for custom playlists 2019-10-15 21:17:14 -04:00
Omar Roth 330ffb803f
Remove invalid source map directive for videojs-quality-selector 2019-10-14 21:07:07 -04:00
Omar Roth e03b4b7505
Hide scrollbar for player menus 2019-10-05 11:51:31 -04:00
Omar Roth e61c8046f4
Fix z-index, scrollbar in player 2019-10-04 12:50:44 -04:00
agony affeeb39de Fixed bug that made the whole 'Invidious' div clickable. Solves #691 2019-10-02 14:05:58 +02:00
Omar Roth 553d52a45e
Update silvermine quality selector 2019-09-26 17:11:10 -04:00
Omar Roth be2ee33273
Fix overflow for player controls 2019-09-24 13:38:50 -04:00
Omar Roth 9766322e99
Update videojs-quality-selector 2019-09-21 22:22:20 -04:00
Omar Roth 7d3ecd2297
Bump JS/CSS dependencies 2019-08-27 08:01:33 -05:00
leonklingele acaf7b969a js: add support to detect alt, meta and control key in keydown handler (#704)
This fixes a quite severe user experience issue where pressing the
'alt', 'meta' and/or 'ctrl' key along with one of the supported keys
(e.g. 'f' to enter video fullscreen mode) would overwrite the default
browser behavior. In the case of 'f+meta' we would enter fullscreen
mode, and not open the browser search panel as one might expect.

This change is required to stay consistent with the way YouTube
handles keydown events.
2019-08-18 23:22:39 -05:00
Omar Roth 2b94975345
Fix playlist_thumbnail extractor 2019-08-16 20:06:21 -05:00
leonklingele e6b4e12689 js: add support for keydown events (#678)
* js: add support for keydown events

This will modify the player behavior even if the player element is unfocused.

Based on the YouTube key bindings, allow to

- toggle playback with space and 'k' key
- increase and decrease player volume with up / down arrow key
- mute and unmute player with 'm' key
- jump forwards and backwards by 5 seconds with right / left arrow key
- jump forwards and backwards by 10 seconds with 'l' / 'j'  key
- set video progress with number keys 0–9
- toggle captions with 'c' key
- toggle fullscreen mode with 'f' key
- play next video with 'N' key
- increase and decrease playback speed with '>' / '<' key

* js: remove unused dependency 'videojs.hotkeys.min.js'

Support for controlling the player volume by scrolling over it is
still retained by copying over the relevant code part from the
aforementioned library.
2019-08-16 16:01:14 -05:00
Dragnucs 7eaac995bd Change font family to better native selection (#679) 2019-08-16 15:59:05 -05:00
psvenk f54fbd057e Add prefers-color-scheme support (#601)
* Add prefers-color-scheme support

This should fix <https://github.com/omarroth/invidious/issues/559>.
The cookie storage format has been changed from boolean
("true"/"false") to tri-state ("dark"/"light"/""), so that users
without a cookie set will get dark mode if they have enabled the dark
theme in their operating system. The code for handling the cookie
state, along with the user's operating system theme, has been factored
out into a new function `update_mode`, which is called both at window
load and at the "storage" event listener, because the "storage" event
listener is only trigerred when a change is made to the localStorage
from another tab/window (for more info - see
<https://stackoverflow.com/a/4679754>).
2019-08-15 11:29:55 -05:00
Omar Roth f6f176afc1
Merge pull request #680 from leonklingele/add-player-styles
Add support for player styles
2019-08-09 13:49:51 -05:00
Omar Roth 3de37a61c5
Update videojs-http-source-selector 2019-08-09 10:36:41 -05:00
Leon Klingele 46577fb128
Add support for player styles
This currently includes the following styles:

- Invidious, the default
- YouTube, using a centered play button and always visible video control bar

Implements https://github.com/omarroth/invidious/issues/670.
Supersedes https://github.com/omarroth/invidious/pull/661.
2019-08-09 02:04:36 +02:00
Leon Klingele fe2cffb25b
Fix jumpy page on search field focus 2019-08-01 09:35:57 +02:00
Omar Roth d034fecc89
Remove default arguments from function definitions 2019-07-20 20:33:44 -05:00
Omar Roth e8a56e0fea
Add '1.75' playback speed 2019-07-14 10:13:40 -05:00
Omar Roth bcd239ac2b
Add community page 2019-07-09 09:31:04 -05:00
Omar Roth aac240fe41
Resize comment thumbnails 2019-07-01 12:08:29 -05:00
Omar Roth 8fad0af935
Add caption styling 2019-06-30 22:46:08 -05:00
Omar Roth a3cc3c57fd
Add cursor: none to player 2019-06-28 20:55:23 -05:00
Omar Roth 0d0d3edeae
Add thumbnail and banners to channel page 2019-06-28 20:48:24 -05:00
Omar Roth cc6d6ddd66
Prevent firing _onStreamProgress after aborting 2019-06-22 20:08:37 -05:00
Omar Roth bbb40aef51
Fix event listener for notifications.js 2019-06-16 18:11:34 -05:00
Omar Roth 485a3e29e7
Optimize get_subscriptions AJAX 2019-06-16 17:33:24 -05:00
Omar Roth 1477f99c2c
Add target="_blank" to embed titles 2019-06-16 14:49:00 -05:00
Omar Roth 2e1f9d5fa9
Fix title URL for embedded videos 2019-06-16 13:14:56 -05:00
Omar Roth 9dea251862
Fix typo in notifications.js 2019-06-16 12:57:56 -05:00
Omar Roth 17edfd6573
Shorten timeout for AJAX 2019-06-16 12:55:17 -05:00
Omar Roth 485459b8b2
Add clickable title for embedded videos 2019-06-16 09:41:33 -05:00
Omar Roth 552f616305
Fix retry on timeout for AJAX requests 2019-06-15 10:09:32 -05:00
Omar Roth 9122f8acee
Add title overlay to embedded videos 2019-06-08 10:52:47 -05:00
Omar Roth ef8c9f093c
Add premiere date to watch page 2019-06-08 10:18:45 -05:00
Omar Roth 8c944815bc
Minor refactor 2019-06-07 21:13:50 -05:00
Omar Roth 8521f04087
Use short URL for sharing videos 2019-06-05 11:10:23 -05:00
Omar Roth e23bab0103
Only add notification event listener after onload 2019-06-01 17:38:49 -05:00
Omar Roth 0338fd42e1
Add support for Web notifications 2019-06-01 16:09:17 -05:00
Omar Roth efd54b7523
Add 'comments' as URL parameter 2019-05-29 14:24:30 -05:00
Omar Roth d68baf08cb
Shrink h1 on mobile 2019-05-28 10:04:04 -05:00
Omar Roth a7578aa709
Update videojs-vtt-thumbnails version 2019-05-27 20:55:34 -05:00
Omar Roth de77c71042
Add "local" to "next video" URLs 2019-05-27 12:16:22 -05:00
Omar Roth 4345b1d930
Reset playbackRate once player has caught up to source 2019-05-20 12:15:48 -05:00
Omar Roth 7d2e1f63b5
Refactor watched_widget.js 2019-05-16 20:51:17 -05:00
Omar Roth e833ccf309
Fix comments for age-restricted videos 2019-05-14 08:18:57 -05:00
Omar Roth bb15dc57a4
Fix font color for captions button 2019-05-11 11:09:45 -05:00
Omar Roth bfa488f77d
Add option to toggle theme without reload 2019-05-09 11:50:44 -05:00
Omar Roth 03be793930
Fix typo in player.js 2019-05-09 08:36:36 -05:00
Omar Roth 37d88d5ff7
Remove referer from XHR 2019-05-08 09:16:11 -05:00
Omar Roth 058711d3a8
Refactor player.js 2019-05-06 11:23:14 -05:00
Omar Roth 2ddc61fa5c
Refactor embed.js 2019-05-06 10:37:22 -05:00
Omar Roth 2faa2ed1f4
Refactor watch.js 2019-05-06 09:48:33 -05:00
Omar Roth 5bda36fb28
Remove source map URL from videojs.hotkeys.min.js 2019-05-05 20:45:46 -05:00
Omar Roth 0099a9822e
Refactor subscribe_widget 2019-05-05 08:38:55 -05:00
Omar Roth 716705aa15
Add mouse hover for video previews 2019-05-04 08:43:41 -05:00
Omar Roth 3f738cf905
Tweak styling for thumbnail video length 2019-05-04 08:43:34 -05:00
Omar Roth 6d92775ab5
Add video previews 2019-05-02 14:36:32 -05:00
Omar Roth 1a9360ca75
Minor formatting changes 2019-05-01 20:03:39 -05:00
Omar Roth 6fb44083ec
Update source and licenses 2019-05-01 07:40:18 -05:00