Playing DRM-protected audio content

For information on downloading DRM-protected content, see Browsing & downloading section of CDL.

For information on playing DRM-free content, see Symbian OS Library or Forum Nokia Wiki.

You can use DRM Audio Player API to play DRM-protected content on a mobile device. If you need to read or edit the audio content, use the Symbian OS Content Access Framework (CAF) API. For more information on CAF API, see Symbian Developer Library.

Figure: The relationship between different DRM-related APIs

Important implementation considerations include:

  • OMA DRM and WMDRM are not interoperable. Mobile device users are not able to use content created in one DRM system in the other one.

  • When creating the application pay attention to the size of the final binary file. Mobile device users may be charged by the size of the file when downloading it. The amount of available memory on the device may also impose limitations on the file size. For details on the available memory, see the specifications of S60 3rd Edition, Feature Pack 1 devices. Choose the specific model and see the Memory details.

  • Multimedia applications can consume the battery power rapidly, so take this into account when designing the application. For more information, see Power management on Forum Nokia.

Playing DRM-protected audio

To allow your application to play DRM-protected content on a device:

  1. Use the methods of the CDrmPlayerUtility class of DRM Audio Player API to construct your application. CDrmPlayerUtility provides the same interface as CMdaAudioPlayerUtility. With the exception of the class name, most of the code is the same.

    DRM Audio Player API allows applications without DRM capability to play DRM-protected content. DRM capability grants access to alter DRM-protected content. Playback of the content does not require the capability.

    The CDrmPlayerUtility is defined in drmaudiosampleplayer.h header file. Add the following line to the cpp file, which is used to deploy the API:

    #include <drmaudiosampleplayer.h>

    The following code snippet shows a class that contains one public method, Play(), to play a DRM-protected audio file:

    class CDrmAudioExample: public CBase, MDrmAudioPlayerCallback
        {
    public: // Constructor and destructor
     
        CDrmAudioExample();	
        ~CDrmAudioExample();
    	
    public: // Public methods
     
        void PlayL(const TDesC& aFileName);
     
    private: // From MdrmAudioPlayerCallback
    	
        void  MdapcInitComplete(TInt aError,
            const TTimeIntervalMicroSeconds &aDuration);
        void  MdapcPlayComplete (TInt aError);
    	
    private: // Member variables
     
        CDrmPlayerUtility* iPlayerUtility;
        RFile iFile;
    	
        };

    The following code snippet shows the implementation of the above header file:

    CDrmAudioExample::CDrmAudioExample()
        {
        }
     
    CDrmAudioExample::~CDrmAudioExample()
        {
        if (iPlayerUtility)
            {
            iPlayerUtility->Stop();
            delete iPlayerUtility;
            }
        iFile.Close();
        }
    	
    void CDrmAudioExample::PlayL(const TDesC& aFileName)
        {
        // Delete old instance of iPlayerUtility and close the file.
        if (iPlayerUtility)
            {
            iPlayerUtility->Stop();
            delete iPlayerUtility;
            iPlayerUtility = 0;
            }
        iFile.Close();
    	
        // Create a new instance of iPlayerUtility and open the file.
        iPlayerUtility = CDrmPlayerUtility::NewL(
            *this, EMdaPriorityNormal, EMdaPriorityPreferenceNone);
        iFile.Open(CCoeEnv::Static()->FsSession(), aFileName,
            EFileShareReadersOnly | EFileStream | EFileRead);
        iPlayerUtility->OpenFileL(iFile);	
        }
     
    void  CDrmAudioExample::MdapcInitComplete(TInt aError,
            const TTimeIntervalMicroSeconds &aDuration)
        {
        if (KErrNone == aError)
            {
            // Set the volume to half of the maximum volume.
            iPlayerUtility->SetVolume( iPlayerUtility->MaxVolume() / 2 );
            iPlayerUtility->Play();
            }
        }
     
    void CDrmAudioExample::MdapcPlayComplete(TInt aError)
        {
        }

    DRM Helper API can be used for dealing with DRM-specific error situations, such as getting rights details, registering and unregistering DRM-protected content for automated use and getting details of DRM-protected content. DRM Helper API is a library API and can be used alongside DRM Audio Player API or CAF API.

  2. Make sure drmaudioplayutility.lib is accessible to your linker when compiling your application by including it in your mmp file or by editing the project properties in your IDE, depending on your build environment.

  3. Make sure you have the correct capabilities information set for your application. Depending on your application you may need for example DRM or MultimediaDD. DRM Audio Player API does not require any capabilities to play DRM-protected content.

Additional information on playing DRM-protected content

For more information see,

For information on other t ype of multimedia content, see eLearning course on FlashLite and Creating Mobile Videos on Forum Nokia.

Related S60 APIs

These are the APIs related to DRM. For information on the relationship between the APIs, see the Figure above.

  • DRM Audio Player API

    DRM Audio Player API allows you to play DRM-protected files without DRM capability.

  • Content Access Framework (CAF) API

    CAF API allows you to play DRM-protected files. Certain methods require DRM capability.

  • DRM Helper API

    DRM Helper API allows you to deal with DRM-specific error situations. This API can be used with DRM Audio Player API or CAF API.

  • OMA DRM CAF Agent API

    OMA DRM CAF Agent API allows you to access OMA DRM-specific content and rights. This API requires CAF API.

  • DRM License Checker API

    DRM License Checker API allows you to DRM-protect data files in your application. This API is not related to the APIs above and is not necessary for playing multimedia content.