10-25-2011 05:23 PM
I'm building an application (JDE 7.0 platform) that makes use of DRMManager APIs. However when the application invokes the "getLicenseChallenge()" API, a DRMException is generated with the detail message"Unable to parse DRM v2 header".
If anyone know how to solve this problem, please help me. Also does the media file need to be encoded with a DRM header?
Thanks
--Tom
String fURI = "file:///" + fileholder.getPath() + fileholder.getFileName();
DRMManager manager = DRMManager.getManager();
String[] perm = new String[]{DRMManager.PERMISSION_DISPLAY};
byte[] permission;
try {
permission = manager.getLicenseChallenge(fURI, perm);
}
catch( ControlledAccessException c)
{
c.printStackTrace();
}
catch (DRMException e )
{
e.printStackTrace();
}
10-28-2011 09:23 AM
What type of DRM are you using? What format is the media file? Can you post a link to a sample file that triggers this?
10-28-2011 01:33 PM
Thanks for your responses.
I have tried to learn how to use "net.rim.device.api.drm.DRMManager" to controll access to a media file that requires a DRM license. I found no documentations or code samples to teahc me how to use the DRMManager APIs except for the document at "http://docs.blackberry.com/en/developers/deliverab
1) What type of DRM license that can be processed by DRMManager APIs (for example Windows DRM license, OMA DRM license, Apple iTunes license, etc)
2) Do I need to write a DRM engine plugged-in to process DRM liceneses in case the DRMManager APIs do not support input DRM licenses.
Here are my example code using DRMManager APIs. I use the code to install an OMA license in an XML format and to retireve the license to play a media file. The media file in in mp3 format stored in a local storage of the phone. Both rightsInstall() and getLicenseChallenge() always throw out a DRMException with a message "Unable to parse DRM v2 header"
Here is my sample license
<o-ex:rights
xmlns
-ex="http://odrl.net/1.1/ODRL-EX"
xmlns
-dd="http://odrl.net/1.1/ODRL-DD"
xmlns:ds="http://www.w3.org/2000/09/xmldsig#/">
<o-ex:context>
<o-dd:version>1.0</o-dd:version>
</o-ex:context>
<o-ex:agreement>
<o-ex:asset>
<o-ex:context>
<o-dd:uid>cid:contentURI</o-dd:uid>
</o-ex:context>
</o-ex:asset>
<o-ex
ermission>
<o-dd
lay>
</o-dd
lay>
</o-ex
ermission>
</o-ex:agreement>
</o-ex:rights>
Here are my sample codes, The codes consists of 3 parts:
Part 1) Implement a DRMRightsInstallCallback interface
public class myDRMRightsINstallCallback implements DRMRightsInstallCallback
{
public public void installOutcome( int outcome )
{
...
}
}
Part 2) Install a DRM license
DRMManager drmManager = DRMManager.getManager();
try
{
manager.installRights( contentURI, licenses, new myDRMInstallCallback() )
}
catch( DRMException drmEx)
{
}
catch( ControlledAccessException caEx)
{
}
Parts 3) Retrieve a licenes after installing a license
try
{
String[] perm = new String[]{DRMManager.PERMISSION_PLAY};
byte[] license = manager.getLicenseChallenge(contefURI, perm);
}
catch( DRMException drmEx)
{
}
catch( ControlledAccessException caEx)
{
}