3 Replies Latest reply on Jan 10, 2011 11:29 PM by andrey.ka

    DRM content playback

    andrey.ka

      Hi, all

       

      I am trying to develop air application with DRM support. I have drm files and i can play them in other players (SMP for example) . But there are some problems in my own player. I am listening VideoElement event TRAIT_ADD to get DRMTrait instance. DRMTrait in UNINITIALIZED state. After that i am listening DRM_STATE_CHANGE event, but it never fired. What should i do to change state to AUTHENTICATION_NEEDED?

       

              var netLoader:NetLoader = new TracingNetLoader();

       


              var videoElement:VideoElement = new VideoElement(null,
                      netLoader
                      );
              videoElement.addEventListener(MediaElementEvent.TRAIT_ADD, function(event:MediaElementEvent):void{
                  if(event.traitType == MediaTraitType.DRM) {
                      var t:DRMTrait = player.media.getTrait(MediaTraitType.DRM) as DRMTrait;
                      t.addEventListener(DRMEvent.DRM_STATE_CHANGE, onDRMStateChange);
                      onDRMStateChange();
                  }

       

              });

       

              videoElement.resource = new URLResource("file:///path_to_file");     
              videoElement.resource.mediaType = MediaType.VIDEO;
              videoElement.smoothing = true;
              player.media = videoElement;

       

       

      ------------------------------------

       

           private function onDRMStateChange(event:DRMEvent=null):void
           {

           }

       

      Help me, please