mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-21 09:22:18 +00:00
Remove PWA limitations stuff
This commit is contained in:
parent
9412905f0c
commit
c45004dc11
2 changed files with 7 additions and 31 deletions
|
|
@ -1,23 +0,0 @@
|
||||||
/* eslint-disable no-alert */
|
|
||||||
import { Icon, Icons } from "../Icon";
|
|
||||||
|
|
||||||
function IosPwaLimitations() {
|
|
||||||
const showAlert = () => {
|
|
||||||
alert(
|
|
||||||
"Due to Apple’s limitations, Picture-in-Picture (PiP) and Fullscreen are disabled on iOS PWAs. Use the browser version to re-enable these features.\n" +
|
|
||||||
"Tip: To hide the iOS home indicator, use guided access within the PWA!",
|
|
||||||
);
|
|
||||||
};
|
|
||||||
|
|
||||||
return (
|
|
||||||
<button
|
|
||||||
type="button"
|
|
||||||
onClick={showAlert}
|
|
||||||
className="tabbable p-2 rounded-full hover:bg-video-buttonBackground hover:bg-opacity-50 transition-transform duration-100 flex items-center gap-3 active:scale-110 active:bg-opacity-75 active:text-white"
|
|
||||||
>
|
|
||||||
<Icon className="text-2xl" icon={Icons.CIRCLE_QUESTION} />
|
|
||||||
</button>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
export default IosPwaLimitations;
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import { ReactNode, useRef, useState } from "react";
|
import { ReactNode, useRef, useState } from "react";
|
||||||
|
|
||||||
import IosPwaLimitations from "@/components/buttons/IosPwaLimitations";
|
|
||||||
import { BrandPill } from "@/components/layout/BrandPill";
|
import { BrandPill } from "@/components/layout/BrandPill";
|
||||||
import { Player } from "@/components/player";
|
import { Player } from "@/components/player";
|
||||||
import { SkipIntroButton } from "@/components/player/atoms/SkipIntroButton";
|
import { SkipIntroButton } from "@/components/player/atoms/SkipIntroButton";
|
||||||
|
|
@ -37,8 +36,7 @@ export function PlayerPart(props: PlayerPartProps) {
|
||||||
const inControl = !enabled || isHost;
|
const inControl = !enabled || isHost;
|
||||||
|
|
||||||
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
|
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
|
||||||
const isIOSPWA =
|
const isPWA = window.matchMedia("(display-mode: standalone)").matches;
|
||||||
isIOS && window.matchMedia("(display-mode: standalone)").matches;
|
|
||||||
|
|
||||||
const [isShifting, setIsShifting] = useState(false);
|
const [isShifting, setIsShifting] = useState(false);
|
||||||
const [isHoldingFullscreen, setIsHoldingFullscreen] = useState(false);
|
const [isHoldingFullscreen, setIsHoldingFullscreen] = useState(false);
|
||||||
|
|
@ -204,7 +202,9 @@ export function PlayerPart(props: PlayerPartProps) {
|
||||||
<div />
|
<div />
|
||||||
<div className="flex justify-center space-x-3">
|
<div className="flex justify-center space-x-3">
|
||||||
{/* Disable PiP for iOS PWA */}
|
{/* Disable PiP for iOS PWA */}
|
||||||
{!isIOSPWA && status === playerStatus.PLAYING && <Player.Pip />}
|
{!isPWA && !isIOS && status === playerStatus.PLAYING && (
|
||||||
|
<Player.Pip />
|
||||||
|
)}
|
||||||
<Player.Episodes inControl={inControl} />
|
<Player.Episodes inControl={inControl} />
|
||||||
{status === playerStatus.PLAYING ? (
|
{status === playerStatus.PLAYING ? (
|
||||||
<div className="hidden ssm:block">
|
<div className="hidden ssm:block">
|
||||||
|
|
@ -212,11 +212,11 @@ export function PlayerPart(props: PlayerPartProps) {
|
||||||
</div>
|
</div>
|
||||||
) : null}
|
) : null}
|
||||||
<Player.Settings />
|
<Player.Settings />
|
||||||
{isIOSPWA && <IosPwaLimitations />}
|
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div>
|
||||||
{/* iOS PWA */}
|
{isPWA && status === playerStatus.PLAYING ? (
|
||||||
{!isIOSPWA && (
|
<Widescreen />
|
||||||
|
) : (
|
||||||
<div
|
<div
|
||||||
onTouchStart={handleTouchStart}
|
onTouchStart={handleTouchStart}
|
||||||
onTouchEnd={handleTouchEnd}
|
onTouchEnd={handleTouchEnd}
|
||||||
|
|
@ -226,7 +226,6 @@ export function PlayerPart(props: PlayerPartProps) {
|
||||||
{isHoldingFullscreen ? <Widescreen /> : <Player.Fullscreen />}
|
{isHoldingFullscreen ? <Widescreen /> : <Player.Fullscreen />}
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
{isIOSPWA && status === playerStatus.PLAYING && <Widescreen />}
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Player.BottomControls>
|
</Player.BottomControls>
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue