Skip to content
This repository has been archived by the owner on Dec 24, 2024. It is now read-only.

Commit

Permalink
fix(vod): set correct isFullscreen value when entering/leaving theate…
Browse files Browse the repository at this point in the history
…r mode
  • Loading branch information
Zibbp committed Feb 18, 2024
1 parent 25366a1 commit 226e0a6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 17 deletions.
12 changes: 0 additions & 12 deletions src/components/Vod/VideoPlayer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import getConfig from "next/config";
import React, { useEffect, useRef, useState } from "react";
import { ActionIcon } from "@mantine/core";
import vodDataBus from "./EventBus";
import { useApi } from "../../hooks/useApi";
import useUserStore from "../../store/user";
Expand All @@ -11,23 +10,12 @@ import '@vidstack/react/player/styles/default/layouts/video.css';

import { MediaPlayer, MediaPlayerInstance, MediaProvider, Poster, Track } from '@vidstack/react';
import { defaultLayoutIcons, DefaultVideoLayout } from '@vidstack/react/player/layouts/default';
import { IconDotsVertical, IconMaximize, IconMinimize } from "@tabler/icons-react";
import ReactDOM from "react-dom";
import TheaterModeIcon from "./TheaterModeIcon";
import { escapeURL } from "../../util/util";
import { useSearchParams } from 'next/navigation'
import { showNotification } from "@mantine/notifications";
import classes from "./VideoPlayer.module.css"
import eventBus from "../../util/eventBus";
// const useStyles = createStyles((theme) => ({
// playerContainer: {
// "--media-max-height": "87vh"
// },
// playerMediaOutlet: {
// paddingBottom: "0",
// height: "100%",
// },
// }));

const NewVideoPlayer = ({ vod }: any) => {
const { publicRuntimeConfig } = getConfig();
Expand Down
6 changes: 1 addition & 5 deletions src/pages/vods/[vodId].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,12 @@ const VodPage = (props: any) => {
queryFn: () => fetchVod(props.vodId),
});





// Theater mode support
useEffect(() => {
eventBus.on("theaterMode", (data) => {
setIsFullscreen(data);
console.debug(`vodId: toggling theater mode: ${data}`)
console.debug(`theaterMode: is mobile: ${isMobile} is fullscreen: ${isFullscreen}`)
setIsFullscreen(!isFullscreen);
if (window.innerWidth < 1000) {
try {
toggle();
Expand Down

0 comments on commit 226e0a6

Please sign in to comment.