pstream is dead; long live pstream taciturnaxolotl.github.io/pstream-ng/
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Fix type error, only show pip if pip is available

Jip Fr 294f31c5 78ae7739

+11 -8
+6
src/components/player/atoms/Pip.tsx
··· 1 1 import { Icons } from "@/components/Icon"; 2 2 import { VideoPlayerButton } from "@/components/player/internals/Button"; 3 3 import { usePlayerStore } from "@/stores/player/store"; 4 + import { 5 + canPictureInPicture, 6 + canWebkitPictureInPicture, 7 + } from "@/utils/detectFeatures"; 4 8 5 9 export function Pip() { 6 10 const display = usePlayerStore((s) => s.display); 11 + 12 + if (!canPictureInPicture() && !canWebkitPictureInPicture()) return null; 7 13 8 14 return ( 9 15 <VideoPlayerButton
+2 -8
src/components/player/display/base.ts
··· 15 15 canChangeVolume, 16 16 canFullscreen, 17 17 canFullscreenAnyElement, 18 + canPictureInPicture, 18 19 canWebkitFullscreen, 20 + canWebkitPictureInPicture, 19 21 } from "@/utils/detectFeatures"; 20 22 import { makeEmitter } from "@/utils/events"; 21 23 ··· 40 42 return levels 41 43 .map((v) => hlsLevelToQuality(v)) 42 44 .filter((v): v is SourceQuality => !!v); 43 - } 44 - 45 - export function canWebkitPictureInPicture(): boolean { 46 - return "webkitSupportsPresentationMode" in document.createElement("video"); 47 - } 48 - 49 - export function canPictureInPicture(): boolean { 50 - return "pictureInPictureEnabled" in document; 51 45 } 52 46 53 47 export function makeVideoElementDisplayInterface(): DisplayInterface {
+3
src/components/player/display/chromecast.ts
··· 179 179 if (containerElement) fscreen.requestFullscreen(containerElement); 180 180 } 181 181 }, 182 + togglePictureInPicture() { 183 + // Can't PIP while Chromecasting 184 + }, 182 185 startAirplay() { 183 186 // cant airplay while chromecasting 184 187 },