1

I am investigating whether is it possible (I am sure it is, I mean simple way) to build a Java-based client desktop App to play DRM protected video stream.

DRM: DASH CENC DRM1, PlayReady, Widevine Classic\Modular, FairPlay.

VLCJ supports the input-from-memory feature to implement custom protocols or DRM but it looks like a painful digging into DRM specifications.

There is a Node.js open-source project DOWNstream for Electron which can help with Widevine DRM. The article describes Java and Electron integration (source) but I guess it is accidental complexity in this case.

Previously I didn't face with video-streaming domain and I wouldn't like to reinvent the wheel so my questions are:

  • It seems that there are no "pure" Java implementations. Why? Because of format wars? security issues?
  • Do you happen to know any simple way (DalvikVM supports Widevine out of the box) to create App without involving "browser techs" like JS?

Thank you. I would appreciate hearing your thoughts.

Minhaj Patel
  • 579
  • 1
  • 6
  • 21
Oleks
  • 1,011
  • 1
  • 14
  • 25
  • Maybe because there has been very little interest in Desktop Java over the last years. All the action has been server-side (or Android, if you want to count that as Java, but there one would use the native media stack). – Thilo Dec 04 '19 at 12:37
  • @Thilo Thank you for your comment. Well desktop UI will stay alive thanks to Web. Actually, Electron is a good example of it. Do you agree that there is no chance for a simple solution? – Oleks Dec 04 '19 at 13:04
  • 1
    Question 1 will attract mostly opinionated answers, which is not in line with SO policies. Question 2 may also be seen as request for recommending any third party tooling that supports your needs, which is also off-topic and will likely attract opinionated suggestions only, which is again not the scope SO wants. – Roman Vottner Dec 04 '19 at 13:08
  • "Desktop UI will stay alive thanks to Web". Quite the opposite, as far as Java is concerned. Applets are completely dead, everything that happens in the web browser is using HTML5/Javascript technology now. Outside of the browser, a lot of "desktop apps" are actually re-packaged web apps (such as Electron), also using Javascript stacks instead of native or Java tools. – Thilo Dec 04 '19 at 13:26
  • @Thilo Makes sense. Ty. – Oleks Dec 04 '19 at 13:33
  • @RomanVottner Thank you for the points. 1. Do you happen to know the right community to ask such question? 2. Well the question was about implementation without involving "browser techs" but not about tools. – Oleks Dec 04 '19 at 13:45
  • For 1) Reddit or Quora seem seem to be places where you can ask anything 2) "any simple way" usually evolves around using something already implemented by someone other, a library or tool. [This github project](https://github.com/southworks/azure-sdk-for-media-services-java-samples) lists at least a Java console application that uses Azure Media SDK to show the usage of PlayReady and Widevine. Google also lists some Android (which is basically Java) libraries that should be able to play such content. Not sure if this is what you are basically looking for – Roman Vottner Dec 04 '19 at 14:27

1 Answers1

2

I think looking at how the DRM's are provided on platforms may help you understand the options and let you think about how you want to approach your solution.

The DRM client functionality, i.e. the DRM functionality which resides on a phone or tablet or laptop etc as opposed to the DRM server side functionality, is generally built in by the device or OS vendor when it the device or OS is being produced/manufactured. For some DRM's on some devices it is also possible to add it via a SDK.

Most DRM's are used via 'native' players in mobile devices and tablets and via the browser on PC's, laptops etc so this is the usual default that you can generally rely on to be supported. Smart TV's and games consoles are more varied and can be either via browser or native depending not he device.

Recently, nearly all mobile and tablet browsers have added support for browser based DRM also, but many DRM's on laptops are restricted to the browser, or more specifically the CDM (Content Decryption Module) browser add on which is DRM specific.

There are DRM's which are supported outside the browser on PC's and laptops - for example Windows based devices will generally support PlayReady DRM in a way that can be accessed by applications. Microsoft provide more infomrtaiopn on this here:

There is a nice diagram which summarises different devices at the above link which I've copied below also as it helps explain:

enter image description here

I am not aware of a similar Widevine or FairPlay support on PC's or laptops although ones may exist or be in development.

So, going back to your problem, the reason that most cross platform applications use Javascript and browser technology for DRM on laptops and PC's is not really a language issue, rather it is because via the browser is the only way to access the DRM functionality on some laptops and PC's.

For Windows you have the option to use the Universal Windows Platform API but this still may not give you want you are looking for and is Windows and PlayReady specific.

Mick
  • 24,231
  • 1
  • 54
  • 120