File tree Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Expand file tree Collapse file tree 4 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 8
8
stop ,
9
9
pause ,
10
10
resume ,
11
+ mimeType ,
11
12
state ,
12
13
} = useMediaRecorder ({ constraints: { audio: true } })
13
14
@@ -42,7 +43,7 @@ function handleStartClick() {
42
43
const audio = computed (() => {
43
44
if (! data .value ? .length || state .value !== ' inactive' )
44
45
return
45
- const blob = new Blob (data .value )
46
+ const blob = new Blob (data .value , {type : mimeType . value } )
46
47
return URL .createObjectURL (blob)
47
48
})
48
49
< / script>
Original file line number Diff line number Diff line change @@ -4,6 +4,11 @@ outline: deep
4
4
5
5
# Examples
6
6
7
+ ::: warning
8
+ Due to a [ bug in WebKit (Safari)] ( https://bugs.webkit.org/show_bug.cgi?id=198015 ) , the ` <audio> ` source blob does only
9
+ work if you set an explicit ` type ` attribute. This is not a problem with the composable, but with the browser itself.
10
+ :::
11
+
7
12
## Basic Example
8
13
9
14
This is a basic example of how to use the ` <script setup> ` syntax in a Vue component.
Original file line number Diff line number Diff line change 8
8
stop ,
9
9
pause ,
10
10
resume ,
11
+ mimeType ,
11
12
state ,
12
13
} = useMediaRecorder ({ constraints: { audio: true } })
13
14
@@ -44,7 +45,7 @@ function handleStartClick() {
44
45
const audio = computed (() => {
45
46
if (! data .value ? .length || state .value !== ' inactive' )
46
47
return
47
- const blob = new Blob (data .value )
48
+ const blob = new Blob (data .value , {type : mimeType . value } )
48
49
return URL .createObjectURL (blob)
49
50
})
50
51
< / script>
Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ export default defineWorkspace([
9
9
browser : {
10
10
enabled : true ,
11
11
name : 'chromium' ,
12
+ headless : true ,
12
13
provider : 'playwright' ,
13
14
providerOptions : {
14
15
context : {
You can’t perform that action at this time.
0 commit comments