The following code is the complete set up for embedding video in ASP.NET Web forms using vdocipher secure streaming. This code has been generated using Visual Studio Community 2015.
For the MVC implementation, please check: https://www.vdocipher.com/blog/2016/02/example-code-for-streaming-protected-video-in-asp-net/
For vbscript implementation of aspx, check this: https://www.vdocipher.com/blog/2015/01/asp-net-implementation-vdocipher-api/
Vdocipher video in asp.net: aspx and aspx.cs files:
Do not save API Secret in the code
API secret is a key which gives your website authority to generate access tokens (OTPs) for video playback. This secret key can also be used to upload, delete videos in your vdocipher account. Hence, it should not be hard-coded in the application. It should be kept as an app secret. In the above example, it has been added to the web.config file which is not the recommended method. Please read this official article on best practices of saving secret keys in ASP.NET.
Download the complete sample application from the Github.
Adding watermark to the videos
Watermark can be added when generating the OTP in the controller file. Please read this article on structuring your watermark and a sample code. The watermark has to be URL-encoded and sent as post data. You shall need to change around line 33 to send annotation information. Let us know if you find any trouble with the watermark setup.
A note about caching
OTP generated here is temporary. You can not cache this OTP and send it to multiple users as it might cause trouble. The OTP once used gets expired and can no longer be used to play video. Some extensions might try to automate the page rendering and especially when on pages that do not need login. The configuration must be set to make sure pages with embedded videos are not cached and cause error while playback.
For reference about how everything works, please check API reference.
Do let us know about your experiences setting up your secure video in asp.net to create your own PPV or subscription-based video portal. and how we can make the integration simpler.
Is it secure to embed Videos in ASP.net web forms?
It is completely secure when using a DRM protected service like VdoCipher and follows the above best practices guide for saving secret keys in ASP.NET
What is required to protect videos in ASP.Net Web-forms?
DRM protected Video Hosting providers like VdoCipher and a guide to embedding like this.
How to apply a watermark on Video in ASP.Net?
Watermark can be added to the secure and smart HTML5 player. Do read our article on “Adding text via watermark” for structuring your watermark and a sample code.
Supercharge Your Business with Videos
At VdoCipher we maintain the strongest content protection for videos. We also work extremely hard to deliver the best viewer experience. We'd love to hear from you, and help boost your video streaming business.
Leave a Reply