0 Replies Latest reply: Jul 12, 2013 9:46 AM by the Masked Mushroom RSS

    "Unpausable" media - control bar undocumented feature

    the Masked Mushroom Community Member

      As I was looking for a way to disable play on some video ad, I stumbled upon a hiden feature of the control bar:

       

      - The play and pause buttons toggle their visibility (and presence in layout) when metadata with the key "Advertisement" is not null on the media.

       

      The feature is not fully functional though. Line 64 of "PlayButton.as" needs to be modified:

       

      //visible ||= media.metadata.getValue("Advertisement") != null;
      visible &&= media.metadata.getValue("Advertisement") == null;
      
      

       

      Then, you can do something like this:

       

      var metadata:Metadata = new Metadata();
      media.metadata.addValue("Advertisement", metadata);
      

       

      ... and the play/pause buttons won't be present while your media is in the player.

       

      Note: I figure this is the most "kosher" way of dealing with the problem. Modifying the PlayTrait (extending it) would actually make it more awkward to handle the media. This method only limits the end user by modifying the GUI. You can still play/pause internally without having to work around your own alterations, and you're less likely to make the media player complain.