You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@cordova.apache.org by GitBox <gi...@apache.org> on 2020/12/16 20:18:09 UTC

[GitHub] [cordova-ios] gerhardsletten edited a comment on issue #1033: Reading big media files make WKWebView crash with cordova-ios-6.x

gerhardsletten edited a comment on issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033#issuecomment-746947594


   @timbru31 You can find an example here: [https://www.dropbox.com/s/900pfcoouh9h9xl/mp3Player.zip?dl=0](https://www.dropbox.com/s/900pfcoouh9h9xl/mp3Player.zip?dl=0)
   
   The 700mb mp3-audio book is to big for a github-repo. Its embedded right into the app to keep the example simple.
   
   When running the app, you can click the `InitAudio` button which will read the file, and insert the native url into a <audio /> tag.
   
   ```
   function initAudioPlayer() {
     const audioEl = document.getElementById('audioEl');
     const file = cordova.file.applicationDirectory + "www/audio/ulyssess-grant.mp3";
     window.resolveLocalFileSystemURL(file, function(entry) {
       audioEl.style.display = "block"
       const nativePath = entry.toURL();
       const usedPath = window.WkWebView.convertFilePath(nativePath)
       audioEl.src = usedPath;
     })
   }
   ```
   
   If you have the memory usage open, you will see a big spike.
   
   <img width="1302" alt="Skjermbilde 2020-12-16 kl  20 42 51" src="https://user-images.githubusercontent.com/63344/102400044-a5654100-3fe1-11eb-9484-bac5694a887b.png">
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org
For additional commands, e-mail: issues-help@cordova.apache.org