mirror of
https://github.com/iv-org/invidious.git
synced 2026-11-03 18:37:23 +00:00
feat: automatically start video and scroll to it if clicking timestamp in comments and description (#6111)
Closes https://github.com/iv-org/invidious/issues/627
This commit is contained in:
@@ -20,6 +20,12 @@
|
|||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
var time = t.getAttribute('data-jump-time');
|
var time = t.getAttribute('data-jump-time');
|
||||||
player.currentTime(time);
|
player.currentTime(time);
|
||||||
|
// The player_html5_api element is the Video.JS player ID.
|
||||||
|
document.getElementById('player_html5_api').scrollIntoView({
|
||||||
|
behavior: 'smooth',
|
||||||
|
block: 'start'
|
||||||
|
});
|
||||||
|
player.play();
|
||||||
break;
|
break;
|
||||||
case 'get_youtube_replies':
|
case 'get_youtube_replies':
|
||||||
var load_more = t.getAttribute('data-load-more') !== null;
|
var load_more = t.getAttribute('data-load-more') !== null;
|
||||||
|
|||||||
Reference in New Issue
Block a user