Widevine Modular with Video.js - html5-video

I'm trying to play a Widevine encrypted MPEG-DASH video, on my webpage, using Video.js. I have the generated .mpd file in S3 and pass the url as I'm supposed to, but get a 403 forbidden error. It's not a permissions issue with AWS, since if I point directly to the .mp4 proxy file, Video.js plays the encrypted version of the video. When I look at the mpd file it seems to separately specify the audio and video files.
Does the audio file need to be separate from the video file in S3?

Related

I need to implement the inApp video download feature same as Netflix,Hotstar,Amazone Prime in React native App?

A couple of months back, I came across a client requirement who wanted to build a feature to download and restrict video files in Android App, just like YouTube, Netflix, Amazon Prime does with us.
The steps need to be implemented is as follows :
Download the video from the URL
Encrypt the video file
Decrypt the video file at the time of playing
I use RNFetchBlob for download the video from the urls and RNFS is used for file access.
Requirement :
I need to encrypt the video file and decrypt the video file from the App.
If anyone knows the solution please help me......
I need to encrypt the video file and decrypt the video file from the App.

Downloading private videos inapp react native

I am trying to implement something in react native:
I have a url of video which i'm showing in react native video component, how can i give a button to download that same video in mobile but it should not appear in gallery.
Also if the video is private where the headers can be passed and how?
How to download any file ?
Well for downloading any file like video,img you first need permission to read and write into internal/external storage of phone and after that you need a native module that can download files from server to the local folders of phone.
there are two best known libraries for downloading files
https://www.npmjs.com/package/react-native-fs
https://www.npmjs.com/package/react-native-fetch-blob
Now you can follow their documentation to download files like Videos,images or whatever you want to your user's phone.
Now Lets come to the part that you dont want it to be available to user via gallery.
For this i suggest using react-native-fetchblob as it has builtin intent actions and views.
You can download a video file with any random name like 1234CACHE any random name without any extension to it, specially dont give it extension like video.mp4 because gallery detects .mp4 files so dont give it any extension and the file won't be available in any gallery.
Now how to hide the file?
react-native-fetch-blob allow us to save files into directories that are not publicly available i mean user cannot reach those directory and these directories are used only for saving App's data so you can save your video file in one of these directories.
Now after completing your download, You can open your file with the Intent.
For Example:-
const VIDEO_PATH = res.path() //the path where your downloaded video is saved, you will actually receive this in the response of download function.
const MIME_TYPE = "video/mp4"
//Now finally call the intent with video mime so the video will be opened in user's media player, or if you want your own media player you can use any library for that.
android.actionViewIntent(VIDEO_PATH , MIME_TYPE)
Note: You can only download a video if you have a path URL to the video file, You must not mix web URL with Video File URL, Video file url has file name and video extension at the end of the url. such as https://someURL.com/video.mp4 this is video file url, but if you have something like https://SomeURL.com/video it is not a video file instead it is a webpage displaying that video file so you cant really download that specific video from a webpage!.
There can be multiple approaches to this.
I hope you have an idea about your video player, download option depends on your server and site.
You can change the file extension of downloaded video, like my_video.notMP4. So the video will not show in the Gallery as it not detected as a video file now.
Hide the folder where the video file is downloaded, adding a dot(.) before the folder name can hide the folder in Android/Unix and video will be hidden from Gallery. Example .my_Video_folder
For more safety, you can encrypt the video and make them in custom chunk which only your player can play. But you may need to make or find such a video player.
I could not understand the headers part, please explain.

S3 Bucket non-encrypted HLS works, but CloudFront of it doesn’t

As the title says. S3 Bucket non-encrypted HLS works, but CloudFront of it doesn’t. I have been trying to get it to work for hours without any success. I followed all the docs closely. I set up header whitelist on CloudFront as well. Please help? When playing the video I get Network error message. It plays without any problem with the S3 Bucket URL. I tried various HLS streaming test websites.
HLS encryption does not work with Sign URL. With HLS encryption we break the video in multiple files (.ts) so if we want our playlist file (.m3u8) can able to access all those .ts files then we need to access those .ts files through signed cookie only.

how to download video from cloudinary using nodejs?

I have uploaded a mp4 file using node.js on my cloudinary account. I have saved public id of video. Is there any api to download the uploaded video?
Use the attachment flag (fl_attachment in URLs) to tell the browser to download the video instead of displaying it.
For example,
http://res.cloudinary.com/<cloud_name>/video/upload/fl_attachment/<public_id>.mp4
For more information on delivery flags,
http://cloudinary.com/documentation/image_transformations#delivery_and_image_format_flags

Can IOS devices stream m3u8 segmented video from the local file system using html5 video and phonegap/cordova?

I'm using phonegap/cordova 2.1 and my app has locally stored assets (on the device) which need to be encrypted on build and decrypted in memory when used in execution. The app is for iPad only.
For the videos I want to implement something similar to http://codebycoffee.com/2012/01/08/decrypting-http-streaming-video-with-nsurlprotocol where mediafilesegmenter is used to segment and encrypt each video file and then a custom encrypted file url protocol serves the key for each video when the video player requests the m3u8 file.
My problem is that I can't seem to play m3u8 files by using the html5 video tag and phonegap/cordova. I have even created unencrypted video segments with the use of mediafilesegmenter as a test. These can be played by opening the m3u8 file with VLC in OSX but when using the video tag in phonegap/cordova I get 'loading...' message followed by a popup saying "The operation could not be completed"
OK so it turns out that m3u8 files have to be served over HTTP and I have gone down the route of bundling a cocoahttpserver https://github.com/robbiehanson/CocoaHTTPServer in with the app. This way I can request the video streams with:
<video src="http://127.0.0.1:12345/path.m3u8"