File tree Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Expand file tree Collapse file tree 2 files changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -64,9 +64,7 @@ export default class ShootingManager {
64
64
// HJ TODO: cleanup이 맞을까?
65
65
this . setUpCanvas ( canvasEl ) ;
66
66
this . setUpVideo (
67
- uaParserManager . getOsName ( ) === "iOS"
68
- ? recordVideoMovSrc
69
- : recordVideoWebmSrc
67
+ uaParserManager . isApple ( ) ? recordVideoMovSrc : recordVideoWebmSrc
70
68
) ;
71
69
// this.setUpAudio(audioSrc);
72
70
this . m_videoName = name ;
@@ -173,8 +171,7 @@ export default class ShootingManager {
173
171
174
172
// the user interaction should be need to use audio context
175
173
private setUpRecorder ( onEnd : ( blob : Blob ) => void ) {
176
- const mimeType =
177
- uaParserManager . getOsName ( ) === "iOS" ? "video/mp4" : "video/webm" ;
174
+ const mimeType = uaParserManager . isApple ( ) ? "video/mp4" : "video/webm" ;
178
175
179
176
console . debug ( CONSOLE_PREFIX , `mimeType : ${ mimeType } ` ) ;
180
177
Original file line number Diff line number Diff line change @@ -116,13 +116,20 @@ class UaParserManager {
116
116
return this . m_device ;
117
117
}
118
118
119
+ public isApple ( ) {
120
+ const osName = this . getOsName ( ) ;
121
+
122
+ return ( [ "Mac OS" , "iOS" ] as const ) . some ( os => os === osName )
123
+ }
124
+
119
125
public getOsName ( ) {
120
126
return this . getOs ( ) . name as OsType ;
121
127
}
122
128
123
129
private getOs ( ) {
124
130
if ( ! this . m_os ) {
125
131
this . m_os = this . m_parser . getOS ( ) ;
132
+ console . debug ( CONSOLE_PREFIX , "getOs" , this . m_os ) ;
126
133
}
127
134
128
135
return this . m_os ;
You can’t perform that action at this time.
0 commit comments