Skip to content

Commit

Permalink
video format
Browse files Browse the repository at this point in the history
  • Loading branch information
clementroche committed Aug 11, 2023
1 parent 9760346 commit afc804b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions libs/webgl/components/content/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@ export function Content() {
.on('click', () => {
const videoStream = gl.domElement.captureStream(60)

mediaRecorderRef.current = new MediaRecorder(videoStream)
mediaRecorderRef.current = new MediaRecorder(videoStream, {
mimeType: 'video/webm;codec=vp8',
})
let chunks = []

mediaRecorderRef.current.addEventListener('dataavailable', (e) => {
Expand All @@ -61,11 +63,11 @@ export function Content() {
mediaRecorderRef.current.start()

mediaRecorderRef.current.addEventListener('stop', () => {
const blob = new Blob(chunks, { type: 'video/mp4' })
const blob = new Blob(chunks, { type: 'video/webm;codec=vp8' })
const videoURL = URL.createObjectURL(blob)
chunks = []
const link = document.createElement('a')
link.download = 'dithering.mp4'
link.download = 'dithering.webm'
link.href = videoURL
link.click()
})
Expand Down

1 comment on commit afc804b

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"⚡️ Lighthouse report for the changes in this commit:

🔴 Performance: 47
🟠 Accessibility: 79
🟢 Best practices: 100
🟠 SEO: 67
🟢 PWA: 90

Lighthouse ran on https://gpu-dithering-jkkye4mni-studio-freight.vercel.app/"

Please sign in to comment.