mirror of
https://github.com/p-stream/p-stream.git
synced 2026-04-07 08:49:24 +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 IosPwaLimitations from "@/components/buttons/IosPwaLimitations";
|
||||
import { BrandPill } from "@/components/layout/BrandPill";
|
||||
import { Player } from "@/components/player";
|
||||
import { SkipIntroButton } from "@/components/player/atoms/SkipIntroButton";
|
||||
|
|
@ -37,8 +36,7 @@ export function PlayerPart(props: PlayerPartProps) {
|
|||
const inControl = !enabled || isHost;
|
||||
|
||||
const isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent);
|
||||
const isIOSPWA =
|
||||
isIOS && window.matchMedia("(display-mode: standalone)").matches;
|
||||
const isPWA = window.matchMedia("(display-mode: standalone)").matches;
|
||||
|
||||
const [isShifting, setIsShifting] = useState(false);
|
||||
const [isHoldingFullscreen, setIsHoldingFullscreen] = useState(false);
|
||||
|
|
@ -204,7 +202,9 @@ export function PlayerPart(props: PlayerPartProps) {
|
|||
<div />
|
||||
<div className="flex justify-center space-x-3">
|
||||
{/* Disable PiP for iOS PWA */}
|
||||
{!isIOSPWA && status === playerStatus.PLAYING && <Player.Pip />}
|
||||
{!isPWA && !isIOS && status === playerStatus.PLAYING && (
|
||||
<Player.Pip />
|
||||
)}
|
||||
<Player.Episodes inControl={inControl} />
|
||||
{status === playerStatus.PLAYING ? (
|
||||
<div className="hidden ssm:block">
|
||||
|
|
@ -212,11 +212,11 @@ export function PlayerPart(props: PlayerPartProps) {
|
|||
</div>
|
||||
) : null}
|
||||
<Player.Settings />
|
||||
{isIOSPWA && <IosPwaLimitations />}
|
||||
</div>
|
||||
<div>
|
||||
{/* iOS PWA */}
|
||||
{!isIOSPWA && (
|
||||
{isPWA && status === playerStatus.PLAYING ? (
|
||||
<Widescreen />
|
||||
) : (
|
||||
<div
|
||||
onTouchStart={handleTouchStart}
|
||||
onTouchEnd={handleTouchEnd}
|
||||
|
|
@ -226,7 +226,6 @@ export function PlayerPart(props: PlayerPartProps) {
|
|||
{isHoldingFullscreen ? <Widescreen /> : <Player.Fullscreen />}
|
||||
</div>
|
||||
)}
|
||||
{isIOSPWA && status === playerStatus.PLAYING && <Widescreen />}
|
||||
</div>
|
||||
</div>
|
||||
</Player.BottomControls>
|
||||
|
|
|
|||
Loading…
Reference in a new issue