Javascript allows you to use various libraries to encrypt files through aes256 and other algorithms, but this is only partially secure. You need a dynamic key exchange mechanism and encryption like DRM for the best video protection.