MediaPlayer Url issue Only on Android 6.0.1











up vote
1
down vote

favorite
2












After Calling the below method The app appears to be stuck on the loading screen and stop responding ,I'm performing my tests on a WiFi network so the connection should not
be the issue. Testing with Android M 6.0.0 works fine, this only occurs
for 6.0.1. Quite annoying, has anybody a hint





   fun getMusic() {
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC)
mediaPlayer.setDataSource(url)
mediaPlayer.prepare()
mediaPlayer.start()
}




My url :http://www.islamicaudio.org/wp-content/uploads/2018/10/2016-07-23-தெளிவு-6-தொழுகையில்-கழா-இருக்கிறதா-islam-in-tamil-mubarak-madani.mp3




this is the Error

java.lang.IllegalStateException
at android.media.MediaPlayer.nativeSetDataSource(Native Method)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1080)
at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1041)
at com.codenex.getbug.MainActivity.getMusic(MainActivity.kt:79)
at com.codenex.getbug.MainActivity$onCreate$1.onClick(MainActivity.kt:55)









share|improve this question




























    up vote
    1
    down vote

    favorite
    2












    After Calling the below method The app appears to be stuck on the loading screen and stop responding ,I'm performing my tests on a WiFi network so the connection should not
    be the issue. Testing with Android M 6.0.0 works fine, this only occurs
    for 6.0.1. Quite annoying, has anybody a hint





       fun getMusic() {
    mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC)
    mediaPlayer.setDataSource(url)
    mediaPlayer.prepare()
    mediaPlayer.start()
    }




    My url :http://www.islamicaudio.org/wp-content/uploads/2018/10/2016-07-23-தெளிவு-6-தொழுகையில்-கழா-இருக்கிறதா-islam-in-tamil-mubarak-madani.mp3




    this is the Error

    java.lang.IllegalStateException
    at android.media.MediaPlayer.nativeSetDataSource(Native Method)
    at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1080)
    at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1041)
    at com.codenex.getbug.MainActivity.getMusic(MainActivity.kt:79)
    at com.codenex.getbug.MainActivity$onCreate$1.onClick(MainActivity.kt:55)









    share|improve this question


























      up vote
      1
      down vote

      favorite
      2









      up vote
      1
      down vote

      favorite
      2






      2





      After Calling the below method The app appears to be stuck on the loading screen and stop responding ,I'm performing my tests on a WiFi network so the connection should not
      be the issue. Testing with Android M 6.0.0 works fine, this only occurs
      for 6.0.1. Quite annoying, has anybody a hint





         fun getMusic() {
      mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC)
      mediaPlayer.setDataSource(url)
      mediaPlayer.prepare()
      mediaPlayer.start()
      }




      My url :http://www.islamicaudio.org/wp-content/uploads/2018/10/2016-07-23-தெளிவு-6-தொழுகையில்-கழா-இருக்கிறதா-islam-in-tamil-mubarak-madani.mp3




      this is the Error

      java.lang.IllegalStateException
      at android.media.MediaPlayer.nativeSetDataSource(Native Method)
      at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1080)
      at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1041)
      at com.codenex.getbug.MainActivity.getMusic(MainActivity.kt:79)
      at com.codenex.getbug.MainActivity$onCreate$1.onClick(MainActivity.kt:55)









      share|improve this question















      After Calling the below method The app appears to be stuck on the loading screen and stop responding ,I'm performing my tests on a WiFi network so the connection should not
      be the issue. Testing with Android M 6.0.0 works fine, this only occurs
      for 6.0.1. Quite annoying, has anybody a hint





         fun getMusic() {
      mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC)
      mediaPlayer.setDataSource(url)
      mediaPlayer.prepare()
      mediaPlayer.start()
      }




      My url :http://www.islamicaudio.org/wp-content/uploads/2018/10/2016-07-23-தெளிவு-6-தொழுகையில்-கழா-இருக்கிறதா-islam-in-tamil-mubarak-madani.mp3




      this is the Error

      java.lang.IllegalStateException
      at android.media.MediaPlayer.nativeSetDataSource(Native Method)
      at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1080)
      at android.media.MediaPlayer.setDataSource(MediaPlayer.java:1041)
      at com.codenex.getbug.MainActivity.getMusic(MainActivity.kt:79)
      at com.codenex.getbug.MainActivity$onCreate$1.onClick(MainActivity.kt:55)






      android url media-player android-6.0.1-marshmallow






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 7 at 6:46

























      asked Nov 7 at 5:22









      Praveen P

      708




      708





























          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














           

          draft saved


          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53183968%2fmediaplayer-url-issue-only-on-android-6-0-1%23new-answer', 'question_page');
          }
          );

          Post as a guest





































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















           

          draft saved


          draft discarded



















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53183968%2fmediaplayer-url-issue-only-on-android-6-0-1%23new-answer', 'question_page');
          }
          );

          Post as a guest




















































































          這個網誌中的熱門文章

          Tangent Lines Diagram Along Smooth Curve

          Yusuf al-Mu'taman ibn Hud

          Zucchini