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 () => {
133133 // inlineStyles: true
134134 // },
135135
136- detection : {
137- performance : true ,
138- browserSupport : true
139- } ,
136+ // detection: {
137+ // performance: true,
138+ // browserSupport: true,
139+ // battery: true
140+ // },
141+
140142 performanceMetrics : {
141143 device : {
142144 hardwareConcurrency : { min : 2 , max : 48 } ,
Original file line number Diff line number Diff line change @@ -92,12 +92,19 @@ const isBatteryLow = async () => {
9292 *
9393 * In this case no video will be played automatically and play throws an error.
9494 */
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+ }
101108} ;
102109
103110export const deprecationWarningButtonSelector = initApp => {
You can’t perform that action at this time.
0 commit comments