Android Question Prevent stop music player when use videoview

Discussion in 'Android Questions' started by Pooya1, Jul 27, 2018.

  1. Pooya1

    Pooya1 Active Member Licensed User

    Hi
    I try use VideoView and ExoPlayer in app without stop android music player
    I use below code for resume music player if it is stoped
    Code:
    Dim jo As JavaObject
        jo.InitializeContext
        jo = jo.RunMethod(
    "getSystemService"Array("audio"))
        
    Dim event As Object = jo.CreateEventFromUI("android.media.AudioManager.OnAudioFocusChangeListener", _
         
    "audio"Null)
        
    Dim p As Phone
        jo.RunMethod(
    "requestAudioFocus"Array (event, p.VOLUME_SYSTEM, 2))
    But i need when user login to my app and see my video,user music player dont be stop
    How do i add this ability in my app?
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    Not sure that I understand. The device is playing music before your app starts and you want it to keep playing the music even when you play a video?
     
    Last edited: Jul 29, 2018
  3. Pooya1

    Pooya1 Active Member Licensed User

    Yes
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    Pooya1 likes this.
  5. Pooya1

    Pooya1 Active Member Licensed User

Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice