@@ -6,7 +6,7 @@ import VlogVideo from "../components/vlogVideo";
6
6
import usePageVisibility from "../hooks/pageVisibility" ;
7
7
import { classNames } from "../utils/classNames" ;
8
8
import { text } from "../utils/constants" ;
9
- import { capitalize } from "../utils/helpers" ;
9
+ import { capitalize , getBrowserName } from "../utils/helpers" ;
10
10
export async function getStaticProps ( ) {
11
11
return {
12
12
props : { } ,
@@ -45,7 +45,8 @@ export default function Vlog() {
45
45
}
46
46
} ;
47
47
useEffect ( ( ) => {
48
- if ( ! document . pictureInPictureEnabled ) {
48
+ const browserName = getBrowserName ( navigator . userAgent ) ;
49
+ if ( ! document . pictureInPictureEnabled || ( browserName !== "chrome" && browserName !== "firefox" ) ) {
49
50
setShowError ( true ) ;
50
51
}
51
52
} , [ ] ) ;
@@ -98,7 +99,10 @@ export default function Vlog() {
98
99
< section className = "container flex flex-wrap items-center content-center justify-center w-full h-full px-4 mx-auto" >
99
100
{ showError && (
100
101
< Modal title = "Oops..." onClose = { onModalClose } >
101
- < p > Opps.... Your browser does not support required features to record video.</ p >
102
+ < p >
103
+ Opps.... Your browser does not support required features to record video. < br /> We recommend using latest
104
+ version of chrome dekstop.
105
+ </ p >
102
106
</ Modal >
103
107
) }
104
108
< h1 className = "w-11/12 mb-10 text-3xl font-bold text-center lg:w-8/12" >
@@ -132,6 +136,7 @@ export default function Vlog() {
132
136
"md:w-1/4 lg:w-1/6" : ! isInitialized ,
133
137
hidden : isInitialized ,
134
138
} ) } `}
139
+ id = "initialize"
135
140
onClick = { ( ) => setIsInitialized ( ! isInitialized ) }
136
141
>
137
142
Initialize
@@ -162,6 +167,7 @@ export default function Vlog() {
162
167
"bg-red-500 hover:bg-red-700" : isRecording ,
163
168
hidden : ! isInitialized ,
164
169
} ) } `}
170
+ id = "startRecording"
165
171
onClick = { handleRecording }
166
172
>
167
173
{ `${ pageTitle || "Start recording" } ...` }
0 commit comments