Class MPMediaAPI


  • public class MPMediaAPI
    extends java.lang.Object
    Utility class to interact with the mParticle Media APIs. Do not directly instantiate this.
    See Also:
    MParticle.Media()
    • Constructor Summary

      Constructors 
      Constructor Description
      MPMediaAPI​(android.content.Context context, MediaCallbacks callbacks)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean getAudioPlaying()  
      void setAudioPlaying​(boolean playing)
      Use this method to inform the SDK that there is audio playing.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • MPMediaAPI

        public MPMediaAPI​(@Nullable
                          android.content.Context context,
                          @NonNull
                          MediaCallbacks callbacks)
    • Method Detail

      • setAudioPlaying

        public void setAudioPlaying​(boolean playing)
        Use this method to inform the SDK that there is audio playing. In the case where a user navigates away from your app, but your app is playing music in the background, using this method will ensure that the mParticle SDK does not end the user's session prematurely. A user's session will be considered active as long as audio is playing, so be sure to use this method both to signal when audio starts, as well as when it pauses or stops.
        Parameters:
        playing - Is your app currently playing music for the user.
      • getAudioPlaying

        public boolean getAudioPlaying()