LarchLiu / vue3-video-player

vue3 version of vue-core-video-player
https://larchliu.github.io/vue3-video-player/
97 stars 20 forks source link

How can i use blob url? #22

Closed KelvynCarbone closed 2 years ago

KelvynCarbone commented 2 years ago

How can i use blob url?

LarchLiu commented 2 years ago
  1. get binary data of video
  2. encapsulate the binary data as a BLOB object
  3. generate a local URL
  4. use blobUrl as src
blobUrl = ref('')
loadVideo('url/video').then(binaryData => {
 const blob = new Blob([binaryData], { type: 'video/mp4' })
 blobUrl.value = (window.URL || window.webkitURL).createObjectURL(blob);
})