add alert when browser recording is not supported

This commit is contained in:
MarconLP 2023-05-03 14:49:31 +02:00
parent 0ddeda1f1c
commit b3467912e7
No known key found for this signature in database
GPG key ID: A08A9C8B623F5EA5
6 changed files with 31 additions and 1 deletions

View file

@ -7,6 +7,12 @@ export default function CTA() {
const posthog = usePostHog();
const openRecordModal = () => {
if (
!navigator?.mediaDevices?.getDisplayMedia &&
!navigator?.mediaDevices?.getDisplayMedia
) {
return alert("Your browser is currently NOT supported.");
}
setRecordOpen(true);
posthog?.capture("open record video modal", {

View file

@ -15,6 +15,12 @@ export default function NewVideoMenu() {
const posthog = usePostHog();
const openRecordModal = () => {
if (
!navigator?.mediaDevices?.getDisplayMedia &&
!navigator?.mediaDevices?.getDisplayMedia
) {
return alert("Your browser is currently NOT supported.");
}
setRecordOpen(true);
posthog?.capture("open record video modal", {

View file

@ -17,7 +17,7 @@ if (typeof window !== "undefined") {
api_host: env.NEXT_PUBLIC_POSTHOG_PROXY_HOST,
// Enable debug mode in development
loaded: (posthog) => {
if (process.env.NODE_ENV === "development") posthog.debug();
if (process.env.NODE_ENV === "development") posthog.debug(false);
},
});
}

View file

@ -18,6 +18,12 @@ const Home: NextPage = () => {
const posthog = usePostHog();
const openRecordModal = () => {
if (
!navigator?.mediaDevices?.getDisplayMedia &&
!navigator?.mediaDevices?.getDisplayMedia
) {
return alert("Your browser is currently NOT supported.");
}
setRecordOpen(true);
posthog?.capture("open record video modal", {

View file

@ -43,6 +43,12 @@ const VideoList: NextPage = () => {
);
const openRecordModal = () => {
if (
!navigator?.mediaDevices?.getDisplayMedia &&
!navigator?.mediaDevices?.getDisplayMedia
) {
return alert("Your browser is currently NOT supported.");
}
setRecordOpen(true);
posthog?.capture("open record video modal", {

View file

@ -31,6 +31,12 @@ const VideoList: NextPage = () => {
}
const openRecordModal = () => {
if (
!navigator?.mediaDevices?.getDisplayMedia &&
!navigator?.mediaDevices?.getDisplayMedia
) {
return alert("Your browser is currently NOT supported.");
}
setRecordOpen(true);
posthog?.capture("open record video modal", {