Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-11313

Can't start media streaming on Android 6.0

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • None
    • cordova-plugin-media
    • None

    Description

      We are trying to play online radio stations with Cordova, for example these stations:
      http://www.hendrikjansen.nl/henk/streaming.html

      But when we try the current released version 2.3.0 or the current dev 2.3.1-dev, both give the same adb logcat output:

      05-24 15:22:08.936 27095 27176 E MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
      05-24 15:22:08.936 27095 27176 E MediaPlayer-JNI: JNIMediaPlayerFactory: bIsQCMediaPlayerPresent 0
      05-24 15:22:08.940   798  3345 I MediaFocusControl:  AudioFocus  requestAudioFocus() from android.media.AudioManager@fd128bforg.apache.cordova.media.AudioHandler$1@932bb8c req=1flags=0x0
      05-24 15:22:08.953 27095 27415 D MediaHTTPConnection: filterOutInternalHeaders: key=User-Agent, val= stagefright/1.2 (Linux;Android 6.0.1)
      05-24 15:22:08.954 27095 27810 D MediaHTTPConnection: proxy null port 0
      05-24 15:22:13.341   258 30530 I FFmpegExtractor: android-source:0xb5f4f8c0
      05-24 15:22:13.343   258 30530 E FFMPEG  : FFSource getSize failed
      05-24 15:22:13.343   258 30530 E FFMPEG  : FFSource getSize failed
      05-24 15:22:13.343   258 30530 E FFMPEG  : FFSource getSize failed
      05-24 15:22:13.343   258 30530 I FFMPEG  : [mp3 @ 0xae696e00] Skipping 0 bytes of junk at 0.
      05-24 15:22:13.343   258 30530 D FFmpegExtractor: suppoted codec(mp3) by official Stagefright
      05-24 15:22:13.343   258 30530 D FFmpegExtractor: ffmpeg detected media content as 'audio/mpeg' with confidence 0.08
      05-24 15:22:13.344   258 30529 D NuPlayerDriver: notifyListener_l(0xae76c0e0), (1, 0, 0)
      05-24 15:22:13.345 27095 27176 D MediaPlayer: setSubtitleAnchor in MediaPlayer
      05-24 15:22:13.347   258  2659 E MediaPlayerService: getDuration returned -2147483648
      05-24 15:22:13.347 27095 27176 W MediaPlayer: Stream has no duration and is therefore not seekable.
      05-24 15:22:13.347 27095 27176 E MediaPlayer: error (-2147483648, 0)
      05-24 15:22:13.347 27095 27176 D AudioPlayer: Send a onStatus update for the new seek
      05-24 15:22:13.348 27095 27176 E MediaPlayer: start called in state 0
      05-24 15:22:13.348 27095 27176 E MediaPlayer: error (-38, 0)
      05-24 15:22:13.348 27095 27176 E MediaPlayer: Attempt to call getDuration without a valid mediaplayer
      05-24 15:22:13.348 27095 27176 E MediaPlayer: error (-38, 0)
      05-24 15:22:13.348 27095 27176 E MediaPlayer: Error (-2147483648,0)
      05-24 15:22:13.348 27095 27176 D AudioPlayer: on completion is calling stopped
      05-24 15:22:13.349 27095 27176 E MediaPlayer: Error (-38,0)
      05-24 15:22:13.349 27095 27176 D AudioPlayer: on completion is calling stopped
      05-24 15:22:13.349 27095 27176 E MediaPlayer: Error (-38,0)
      05-24 15:22:13.349 27095 27176 D AudioPlayer: on completion is calling stopped
      

      If I comment out the lines https://github.com/apache/cordova-plugin-media/blob/master/src/android/AudioPlayer.java#L435 (this.seekToPlaying(this.seekOnPrepared);) and https://github.com/apache/cordova-plugin-media/blob/master/src/android/AudioPlayer.java#L445 (this.duration = getDurationInSeconds();). It does start the stream, but as soon as I receive a notification from a different app (for example a new WhatApp message) the MediaPlayer crashes.

      Attachments

        Issue Links

          Activity

            People

              macdonst Simon MacDonald
              markdark Mark Veenstra
              Votes:
              2 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: