I have decided to try out VdoCipher and protect my membership videos from theft or at least make it harder, as YouTube, Wistia or VimeoPro do not make illegal downloads harder :)
VdoCipher provides a simple API on their website and I got from them php and classis asp code but I still couldn't make it work with asp.net. I'm no expert in API and I used to employ a freelancer to do it for me but this time I decided to do it myself and learn how to use APIs with asp.net.
Below is an API novice level code that does the job :)
All my code is in 'code behind' of a single asp.net page which works for me as my website is pretty much one page (database/code driven).
Remember to enter Client Secret Key and Video ID and I output the result using asp.net literal control.
Partial Class VdoCipher
Public Function vdocipher_sendCommand(action As String, getData As String) As String
Dim strGetURL As String = "http://api.vdocipher.com/v2/" + action + "?" + getData
Dim strResult As String
Using client As New Net.WebClient
Dim reqparm As New Specialized.NameValueCollection
reqparm.Add("clientSecretKey", "*********** ENTER CLIENT SECRET KEY ***********")
Dim responsebytes = client.UploadValues(strGetURL, "POST", reqparm)
Dim responsebody = (New Text.UTF8Encoding).GetString(responsebytes)
strResult = responsebody
Public Function vdocipher_player(strVideoID As String) As String
Dim strOtp As String
Dim strVideoCode As String = ""
Dim strHeight As String = 480
Dim strWidth As String = 720
strOtp = vdocipher_sendCommand("otp", "video=" + strVideoID)
strOtp = strOtp.Substring(8, strOtp.Length - 10)
If Not strOtp Is Nothing Then
strVideoCode = "<div id='vdo" + strOtp + "' ></div>"
strVideoCode += "<scr" + "ipt src='https://de122v0opjemw.cloudfront.net/utils/playerInit.php?otp=" + strOtp + "&height=" + strHeight + "&width=" + strWidth + "'></" + "scr" + "ipt>"
Protected Sub VdoCipher_Load(sender As Object, e As EventArgs) Handles Me.Load
'Output the result using asp.net literal control
litVdoCipher.Text = vdocipher_player("****** VIDEO ID GOES HERE *********")
Hope that the code above will help someone else as well :)