diff options
Diffstat (limited to 'src/features')
| -rw-r--r-- | src/features/messages.js | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/features/messages.js b/src/features/messages.js index 55a4376..16ae3a2 100644 --- a/src/features/messages.js +++ b/src/features/messages.js @@ -7662,7 +7662,17 @@ export function messagesFeature(ctx) { return true; } if (typeof document !== 'undefined') document.addEventListener('fullscreenchange', () => { - if (fsElement()) return; + const el = fsElement(); + // The player's own full-screen button on a feed clip: the pager, not + // Chrome's full screen (no next clip there). The button stays on the bar + // (left off, Chrome greys it out) and is taken over here. + if (el && !pager && el.matches && el.matches('.notes-feed video.note-video') && el.dataset.clip) { + const url = el.dataset.clip; + Promise.resolve((document.exitFullscreen || document.webkitExitFullscreen || (() => {})).call(document)).catch(() => {}) + .then(() => { if (!pager && document.contains(el)) openClip(el, url); }); + return; + } + if (el) return; // out of the pager's full screen some other way (Back on Android, Escape // on a computer): out of the pager too, in the one step if (pagerFs) { pagerFs = false; if (pager) dismissPager(); } @@ -7676,10 +7686,8 @@ export function messagesFeature(ctx) { // play button: no seek bar, no sound button. Without autoplay the // player's own controls are the way in, so they stay. const idle = autoplayOk() && !wokeClips.has(url); - // In the feed a tap on the clip opens the pager, so the player's own - // full-screen button (Chrome's full screen: no next clip, and its notice) - // is left off its bar there. - const v = h('video', { src: playSrc(url), class: 'note-video', controls: idle ? undefined : true, controlslist: ui.chatOpen && ui.msgView === 'feed' && !ui.noteThread && !ui.profilePk ? 'nofullscreen' : undefined, poster: videoThumbs.get(url) || (videoInfo.get(url) || {}).image || serverThumb(url), + // (data-clip: which clip it is, for the full-screen button's pager) + const v = h('video', { src: playSrc(url), class: 'note-video', controls: idle ? undefined : true, 'data-clip': url, poster: videoThumbs.get(url) || (videoInfo.get(url) || {}).image || serverThumb(url), preload: 'none', playsinline: true, muted: loud ? undefined : true, style: stable ? videoBoxStyle(feedMedia(url)) : undefined, // learned now, used by the next paint of any row with this clip |
