File tree Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Expand file tree Collapse file tree 2 files changed +19
-10
lines changed Original file line number Diff line number Diff line change @@ -133,10 +133,12 @@ export default defineNuxtConfig(async () => {
133
133
// inlineStyles: true
134
134
// },
135
135
136
- detection : {
137
- performance : true ,
138
- browserSupport : true
139
- } ,
136
+ // detection: {
137
+ // performance: true,
138
+ // browserSupport: true,
139
+ // battery: true
140
+ // },
141
+
140
142
performanceMetrics : {
141
143
device : {
142
144
hardwareConcurrency : { min : 2 , max : 48 } ,
Original file line number Diff line number Diff line change @@ -92,12 +92,19 @@ const isBatteryLow = async () => {
92
92
*
93
93
* In this case no video will be played automatically and play throws an error.
94
94
*/
95
- export const canVideoPlay = blob => {
96
- const video = document . createElement ( 'video' ) ;
97
- video . muted = true ;
98
- video . playsinline = true ;
99
- video . src = URL . createObjectURL ( blob ) ;
100
- return video . play ( ) ;
95
+ export const canVideoPlay = async blob => {
96
+ const objectUrl = URL . createObjectURL ( blob ) ;
97
+ try {
98
+ const video = document . createElement ( 'video' ) ;
99
+ video . muted = true ;
100
+ video . playsinline = true ;
101
+ video . src = objectUrl ;
102
+ await video . play ( ) ;
103
+ URL . revokeObjectURL ( objectUrl ) ;
104
+ } catch ( error ) {
105
+ URL . revokeObjectURL ( objectUrl ) ;
106
+ throw error ;
107
+ }
101
108
} ;
102
109
103
110
export const deprecationWarningButtonSelector = initApp => {
You can’t perform that action at this time.
0 commit comments