mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-01 16:55:21 +03:00
removed some video controls for mobile devices
This commit is contained in:
parent
c8d4d58a72
commit
388406621f
@ -88,7 +88,7 @@ export default function VideoPlayer({ children, options, seekOptions = {}, onRea
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div data-vjs-player>
|
<div data-vjs-player>
|
||||||
<video ref={playerRef} className="video-js vjs-default-skin" controls playsinline />
|
<video ref={playerRef} className="small-player video-js vjs-default-skin" controls playsinline />
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -36,5 +36,20 @@ Maintain aspect ratio and scale down the video container
|
|||||||
Could not find a proper tailwind css.
|
Could not find a proper tailwind css.
|
||||||
*/
|
*/
|
||||||
.outer-max-width {
|
.outer-max-width {
|
||||||
max-width: 60%;
|
max-width: 70%;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
Hide some videoplayer controls on mobile devices to
|
||||||
|
align the video player and bottom control bar properly.
|
||||||
|
*/
|
||||||
|
@media only screen and (max-width: 700px) {
|
||||||
|
.small-player .vjs-time-control,
|
||||||
|
.small-player .vjs-time-divider {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
div.vjs-control-bar > .skip-back.skip-5,
|
||||||
|
div.vjs-control-bar > .skip-forward.skip-10 {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { h, Fragment } from 'preact';
|
import { h, Fragment } from 'preact';
|
||||||
import { useCallback, useState, useEffect, useRef } from 'preact/hooks';
|
import { useCallback, useState, useEffect } from 'preact/hooks';
|
||||||
import Link from '../components/Link';
|
import Link from '../components/Link';
|
||||||
import ActivityIndicator from '../components/ActivityIndicator';
|
import ActivityIndicator from '../components/ActivityIndicator';
|
||||||
import Button from '../components/Button';
|
import Button from '../components/Button';
|
||||||
@ -33,9 +33,8 @@ export default function Event({ eventId, close, scrollRef }) {
|
|||||||
// When opening new event window, the previous one will sometimes cause the
|
// When opening new event window, the previous one will sometimes cause the
|
||||||
// navbar to be visible, hence the "hide nav" code bellow.
|
// navbar to be visible, hence the "hide nav" code bellow.
|
||||||
// Navbar will be hided if we add the - translate - y - full class.appBar.js
|
// Navbar will be hided if we add the - translate - y - full class.appBar.js
|
||||||
console.log('getElementById');
|
const element = document.getElementById('appbar');
|
||||||
let element = document.getElementById('appbar');
|
if (element) element.classList.add('-translate-y-full');
|
||||||
element.classList.add('-translate-y-full');
|
|
||||||
};
|
};
|
||||||
}, [data, scrollRef, eventId, shouldScroll]);
|
}, [data, scrollRef, eventId, shouldScroll]);
|
||||||
|
|
||||||
@ -70,23 +69,33 @@ export default function Event({ eventId, close, scrollRef }) {
|
|||||||
return (
|
return (
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="flex md:flex-row justify-between flex-wrap flex-col">
|
<div className="flex md:flex-row justify-between flex-wrap flex-col">
|
||||||
<div class="space-x-4">
|
<div className="space-y-2 xs:space-y-0 xs:space-x-4">
|
||||||
<Button color="blue" href={`${apiHost}/api/events/${eventId}/clip.mp4?download=true`} download>
|
<Button
|
||||||
|
className="w-full xs:w-auto"
|
||||||
|
color="blue"
|
||||||
|
href={`${apiHost}/api/events/${eventId}/clip.mp4?download=true`}
|
||||||
|
download
|
||||||
|
>
|
||||||
<Clip className="w-6" /> Download Clip
|
<Clip className="w-6" /> Download Clip
|
||||||
</Button>
|
</Button>
|
||||||
<Button color="blue" href={`${apiHost}/api/events/${eventId}/snapshot.jpg?download=true`} download>
|
<Button
|
||||||
|
className="w-full xs:w-auto"
|
||||||
|
color="blue"
|
||||||
|
href={`${apiHost}/api/events/${eventId}/snapshot.jpg?download=true`}
|
||||||
|
download
|
||||||
|
>
|
||||||
<Snapshot className="w-6" /> Download Snapshot
|
<Snapshot className="w-6" /> Download Snapshot
|
||||||
</Button>
|
</Button>
|
||||||
<Button className="self-start" onClick={() => setShowDetails(!showDetails)}>
|
<Button className="w-full xs:w-auto" onClick={() => setShowDetails(!showDetails)}>
|
||||||
<ArrowDown className="w-6" />
|
<ArrowDown className="w-6" />
|
||||||
{`${showDetails ? 'Hide event Details' : 'View event Details'}`}
|
{`${showDetails ? 'Hide event Details' : 'View event Details'}`}
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
<div class="space-x-4">
|
<div class="space-y-2 space-x-2 xs:space-y-0 xs:space-x-4">
|
||||||
<Button className="self-start" color="red" onClick={handleClickDelete}>
|
<Button className="xs:w-auto" color="red" onClick={handleClickDelete}>
|
||||||
<Delete className="w-6" /> Delete event
|
<Delete className="w-6" /> Delete event
|
||||||
</Button>
|
</Button>
|
||||||
<Button color="gray" className="self-start" onClick={() => close()}>
|
<Button color="gray" className="xs:w-auto" onClick={() => close()}>
|
||||||
<Close className="w-6" /> Close
|
<Close className="w-6" /> Close
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
@ -141,13 +150,13 @@ export default function Event({ eventId, close, scrollRef }) {
|
|||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
<div className="outer-max-width xs:m-auto">
|
<div className="outer-max-width xs:m-auto">
|
||||||
<div className="pt-5 relative pb-20">
|
<div className="pt-5 relative pb-20 w-screen xs:w-full">
|
||||||
{data.has_clip ? (
|
{data.has_clip ? (
|
||||||
<Fragment>
|
<Fragment>
|
||||||
<Heading size="lg">Clip</Heading>
|
<Heading size="lg">Clip</Heading>
|
||||||
<VideoPlayer
|
<VideoPlayer
|
||||||
options={{
|
options={{
|
||||||
// preload: 'none',
|
preload: 'none',
|
||||||
sources: [
|
sources: [
|
||||||
{
|
{
|
||||||
src: `${apiHost}/vod/event/${eventId}/index.m3u8`,
|
src: `${apiHost}/vod/event/${eventId}/index.m3u8`,
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
import { h, Fragment } from 'preact';
|
import { h } from 'preact';
|
||||||
import { memo } from 'preact/compat';
|
import { memo } from 'preact/compat';
|
||||||
import { useCallback, useState, useMemo, useEffect } from 'preact/hooks';
|
import { useCallback, useState, useMemo } from 'preact/hooks';
|
||||||
import { Tr, Td, Tbody } from '../../../components/Table';
|
import { Tr, Td, Tbody } from '../../../components/Table';
|
||||||
import Filterable from './filterable';
|
import Filterable from './filterable';
|
||||||
import Event from '../../Event';
|
import Event from '../../Event';
|
||||||
@ -43,17 +43,16 @@ const EventsRow = memo(
|
|||||||
|
|
||||||
const start = new Date(parseInt(startTime * 1000, 10));
|
const start = new Date(parseInt(startTime * 1000, 10));
|
||||||
const end = new Date(parseInt(endTime * 1000, 10));
|
const end = new Date(parseInt(endTime * 1000, 10));
|
||||||
// console.log('tablerow has been rendered');
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tbody reference={innerRef} key={id}>
|
<Tbody reference={innerRef}>
|
||||||
<Tr data-testid={`event-${id}`} className={`${viewEvent === id ? 'border-none' : ''}`}>
|
<Tr data-testid={`event-${id}`} className={`${viewEvent === id ? 'border-none' : ''}`}>
|
||||||
<Td className="w-40">
|
<Td className="w-40">
|
||||||
<a
|
<a
|
||||||
onClick={() => viewEventHandler(id)}
|
onClick={() => viewEventHandler(id)}
|
||||||
ref={lastRowRef}
|
ref={lastRowRef}
|
||||||
data-start-time={startTime}
|
data-start-time={startTime}
|
||||||
// data-reached-end={reachedEnd}
|
// data-reached-end={reachedEnd} <-- Enable this will cause all events to re-render when reaching end.
|
||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
width="150"
|
width="150"
|
||||||
|
|||||||
@ -1,4 +1,4 @@
|
|||||||
import { useCallback, useEffect, useRef, useState } from 'preact/hooks';
|
import { useEffect, useRef } from 'preact/hooks';
|
||||||
|
|
||||||
// https://stackoverflow.com/a/54292872/2693528
|
// https://stackoverflow.com/a/54292872/2693528
|
||||||
export const useOuterClick = (callback) => {
|
export const useOuterClick = (callback) => {
|
||||||
|
|||||||
@ -80,8 +80,6 @@ export default function Events({ path: pathname, limit = API_LIMIT } = {}) {
|
|||||||
),
|
),
|
||||||
[apiHost, handleFilter, pathname, scrollToRef]
|
[apiHost, handleFilter, pathname, scrollToRef]
|
||||||
);
|
);
|
||||||
|
|
||||||
// console.log('main render');
|
|
||||||
return (
|
return (
|
||||||
<div className="space-y-4 w-full">
|
<div className="space-y-4 w-full">
|
||||||
<Heading>Events</Heading>
|
<Heading>Events</Heading>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user