let video = document.createElement('video')
let url = URL.createObjectURL(file.data)
video.src = url
video.addEventListener('loadedmetadata', () => {
const newVideo: UploadVideo = {
name: file.name,
size: file.size,
duration: video.duration,
resolution: `${video.videoWidth}*${video.videoHeight}`,
status: 'noStatus',
}
})
createObjectURL
by blob
data(in this ex name is file.data
)loadedmetadata
event happenvideo.duration
, video.videoHeight
, video.videoWidth
duration
and resolution
(width * height)