How to get the video size from the path?

Asked

Viewed 105 times

0

Please follow the image below:

inserir a descrição da imagem aqui

Video size is inside "context" (Path: context > Files :Filelist > 0:File > size)

How to get the video size from the path above ?

1 answer

1


If you want to get the video size and are using the same function as your another question, you can get by attribute size which is returned in bytes. Then to convert in MB:

var tamanho = (this.files[0].size/1024)/1024; // Bytes > KB > MB

Jsfiddle: https://jsfiddle.net/ckLnyn5t/2/

  • 1

    Thanks, now I get it.

  • 1

    Because 1024 bytes is 1 KB, and 1024 KB is 1 MB, so on. Behold

  • 1

    @Matheusmiranda, I tested with a smaller video and the return in size was compatible. Did you have looked for the wrong file (other than uploaded) by right clicking?

  • 1

    Now it worked, it was a mistake to write, thanks @Lucascosta

Browser other questions tagged

You are not signed in. Login or sign up in order to post.