Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26076] Android : WebView Html5 Audio / Video Not playing from External Storage

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-06-11T23:24:46.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, audio, externalstorage, video, webview
ReporterJignesh Kasundra
AssigneeEric Merriman
Created2018-05-23T06:47:01.000+0000
Updated2019-06-11T23:24:46.000+0000

Description

[ERROR] : MediaResourceGetter: Invalid url: java.lang.RuntimeException: setDataSource failed: status = 0x80000000 [ERROR] : MediaPlayer: error (262, 0) [ERROR] : MediaPlayer: Unable to create media player ================ The audio / video file from *external storage* not playing under webview. Note: please check the attached code (app.js) on my android deice I have copied both audio file into the directory where created index.html file is present

Attachments

FileDateSize
AudioVideoDemo.zip2018-05-29T11:38:12.000+0000717269
sound.zip2018-05-29T11:39:34.000+00002429677

Comments

  1. Hans Knöchel 2018-05-23

    Make sure you have permissions granted before:
       var permissions = ['android.permission.READ_EXTERNAL_STORAGE'];
       
       Ti.Android.requestPermissions(permissions, function(e) {
           if (e.success) {
               Ti.API.info("SUCCESS");
           } else {
               Ti.API.info("ERROR: " + e.error);
           }
       });
       
  2. Jignesh Kasundra 2018-05-23

    Hi Hans, I am facing this issue on android OS 4.4.2. device Yes the app have read-write permission. I am able to write the html file into external storage and also able to point (read) that page (index.html) into webview successfully. the page is displayed fine but on click the audio control the audio is not playing. and it display error on Applelerator studio logs window as I mentioned in description.
  3. Hans Knöchel 2018-05-23

    The error indicates an invalid URL then. Make sure you are passing the correct one to the webView. Support will be able to get further infos here.
  4. Jignesh Kasundra 2018-05-23

    yes, as the html file and audio file both present in *same directory(AudioFiles)* so for src simply filename should work but it's not working out. I have also tried nativePath as well but that is also not work out
       <audio controls="controls" id="audioPlayer1" preload="none" title="About audio">
       	<source id="source1" src="time_to_go.mp3" type="audio/mpeg"></source>
       </audio>
       <audio controls="controls" id="audioPlayer3" preload="none" title="About audio">
       		<source id="source3" src="file:///storage/emulated/0/com.example.audiovideodemo/AudioFiles/time_to_go.ogg" type="audio/ogg"></source>
       </audio>
       
    here localPath >>> file:///storage/emulated/0/com.example.audiovideodemo/AudioFiles
  5. Jignesh Kasundra 2018-05-24

    hello, has anybody looked out this issue ? can you please help us to resolve this issue as soon as possible. it’s showstopper issue for us
  6. Sharif AbuDarda 2018-05-28

    Hello, Please provide a full reproducible sample project that we can use to test the issue on our end. If the issue is reproducible we will forward it for a fix. Thanks.
  7. Jignesh Kasundra 2018-05-29

    Hi, I have attached sample project and sound files please check it.
  8. Jignesh Kasundra 2018-07-06

    Hello, can you please take this bug on priority if possible. we have learning base app and we are using webview to render html content which also includes media content. as audio/video not working from external storage is showstopper issue for us. thanks.
  9. Jignesh Kasundra 2018-08-01

    Hello, can you please try to resolve this as possible as soon. the android webview html5 audio/video not working from external storage on any of the Android version the app have EXTERNAL READ-WRITE STORAGE PERMISSION. thanks.
  10. Jignesh Kasundra 2018-08-16

    hello, my issue is resolved. this is not SDK bug. please close the ticket thanks
  11. Alan Hutton 2019-06-11

    Closing per reporter comments.

JSON Source