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/11/27 20:06:40 UTC

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

gerhardsletten opened a new issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033


   # Bug Report
   After migration from cordova-ios-5.x to cordova-ios-6.x we now see that the cordova no longer support reading files in chunks. Instead the whole file is loaded into memory, which will limit file access to what is available on your device.
   
   ## Problem
   After what I can see, it looks like [CDVURLSchemeHandler](https://github.com/apache/cordova-ios/blob/master/CordovaLib/Classes/Public/CDVURLSchemeHandler.m) is handling access of local files in a cordova app, and it does not support delivering files with range headers so WKWebView don't need to load the whole file at once.
   
   ### What is expected to happen?
   Earlier with UIWebView we did not experience this so I guess that cordova on UIWebView handled this by reading these files in chunks.
   
   ### What does actually happen?
   Running simulator or a device attached to xcode we see a memory spike at the same size as the file you try to access. If you are on a device that can not handle this, it will result in a restart of the webview.
   
   ## Information
   Think the same problem is reported here for [cordova-plugin-ionic-webview](https://github.com/ionic-team/cordova-plugin-ionic-webview/issues/378)
   
   ### Version information
   cordova-ios@6.1.1
   
   ## Checklist
   
   - [x] I searched for existing GitHub issues
   - [x] I updated all Cordova tooling to most recent version
   - [x] I included all the necessary information above
   


----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
gerhardsletten commented on issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033#issuecomment-740561320


   @timbru31 Will do, I was looking for examples of stream-delivery with `WKURLSchemeTask`, but I have not found anything yet. Would think that also for native iOS apps, there would be use cases where content would be displayed within a WKWebView for simpler formatting, but maybe they would use the native playback of locally stored video and audio-file.
   
   In this app I work with, we both support streaming and local playback of audiobooks, and since cordova-plugin-media did not support streaming, using the build in audio-tag in html5 worked well for both cases in the previous versions of cordova-ios.


----------------------------------------------------------------
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


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

Posted by GitBox <gi...@apache.org>.
gerhardsletten commented on issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033#issuecomment-987747659


   Did research a lot if there was some way around this, but since you have to upgrade to WKWebView to work on the latests ios-versions and since cordova with WKWebView don't support a streamed reading of files, cordova is not longer an option if your app require these things. I migrated the app over to React Native.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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


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

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [cordova-ios] mlegenhausen commented on issue #1033: Reading big media files make WKWebView crash with cordova-ios-6.x

Posted by GitBox <gi...@apache.org>.
mlegenhausen commented on issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033#issuecomment-923800946


   I can confirm the problem. We have an offline functionality in our app that downloads a video of roughly the same size. When using the generated path from `convertFilePath` in the `source` tag for an `video` element the app crashes randomly due to these memory spikes and what was previously to `cordova-ios@6` an instant load of the video now takes "ages" do to the loading time of the file into memory.


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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


[GitHub] [cordova-ios] timbru31 commented on issue #1033: Reading big media files make WKWebView crash with cordova-ios-6.x

Posted by GitBox <gi...@apache.org>.
timbru31 commented on issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033#issuecomment-740210892


   Can you share an example project that we could use to debug the issue?


----------------------------------------------------------------
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


[GitHub] [cordova-ios] iyevpak commented on issue #1033: Reading big media files make WKWebView crash with cordova-ios-6.x

Posted by GitBox <gi...@apache.org>.
iyevpak commented on issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033#issuecomment-987732463


   Hello,
   any news about this problem?


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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


[GitHub] [cordova-ios] iyevpak commented on issue #1033: Reading big media files make WKWebView crash with cordova-ios-6.x

Posted by GitBox <gi...@apache.org>.
iyevpak commented on issue #1033:
URL: https://github.com/apache/cordova-ios/issues/1033#issuecomment-990854134


   Thanks for reply


-- 
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.

To unsubscribe, e-mail: issues-unsubscribe@cordova.apache.org

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


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

Posted by GitBox <gi...@apache.org>.
gerhardsletten commented 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