I think it's impossible to write a javascript based bittorrent client.
You don't have other choices. You will need a server backend with transmission, which does the P2P part, ffmpeg to compress the file to save bandwidth when you stream it to users.
In the best case, you should need a server with Gbit connection for every 100 user.
Why you would do this if people have popcorntime on their computers for free?
I am sorry, but I think this project won't be profitable..