Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Videos served from file system thorugh local server are not seekable on android #205

Closed
yelhouti opened this issue Nov 5, 2018 · 5 comments · Fixed by #298
Closed

Videos served from file system thorugh local server are not seekable on android #205

yelhouti opened this issue Nov 5, 2018 · 5 comments · Fixed by #298
Labels

Comments

@yelhouti
Copy link

yelhouti commented Nov 5, 2018

When using the html5 video tag with a video sotored in the assets, seek is not possible.

Possible cause/fix:
Server does not support "partial content":
WebViewLocalServer:createWebResourceResponse uses WebViewLocalServer:PathHandler which always answers with 200 OK instead 206 PartialContent for videos. doing so would allow html5 video player to seek video and load in memory only the desired parts

@T0shik
Copy link

T0shik commented Dec 9, 2018

I am also facing this issue, and it's stopping me from implementing trimming in an Ionic 4 application.

Update Ionic Info


Ionic:

   ionic (Ionic CLI)             : 4.5.0 (C:\Users\Toshik\AppData\Roaming\npm\node_modules\ionic)
   Ionic Framework               : @ionic/angular 4.0.0-beta.15
   @angular-devkit/build-angular : 0.11.0
   @angular-devkit/schematics    : 7.1.0
   @angular/cli                  : 7.1.0
   @ionic/angular-toolkit        : 1.2.0

Cordova:

   cordova (Cordova CLI) : 8.1.2 (cordova-lib@8.1.1)
   Cordova Platforms     : android 6.4.0
   Cordova Plugins       : cordova-plugin-ionic-keyboard 2.0.5, cordova-plugin-ionic-webview 2.3.0, (and 9 other plugins)

System:

   NodeJS : v10.13.0 (C:\Program Files\nodejs\node.exe)
   npm    : 6.4.1
   OS     : Windows 10

Update 2 For anyone who stumbles over this an would like to seek the video, I solved it by loading the file as a blob.

  let localFileSrc = this.webview.convertFileSrc(localFilePath);
  fetch(localFileSrc)
    .then(res => res.blob())
    .then(res => {
      let seekableSrc = URL.createObjectURL(res);
    })

@lounai-chen
Copy link

Me too

@jcesarmobile
Copy link
Member

Can you try with this changes? #295

jcesarmobile added a commit to jcesarmobile/cordova-plugin-ionic-webview that referenced this issue Feb 4, 2019
Properly handle requests with Range header and return appropriate headers so audio and video tags
work correcly and you can go forward or backward ond them

fix ionic-team#248, fix ionic-team#205, fix ionic-team#141
jcesarmobile added a commit that referenced this issue Feb 4, 2019
)

Properly handle requests with Range header and return appropriate headers so audio and video tags
work correcly and you can go forward or backward ond them

fix #248, fix #205, fix #141
Ionitron added a commit that referenced this issue Feb 4, 2019
## [3.1.2](v3.1.1...v3.1.2) (2019-02-04)

### Bug Fixes

* **Android:** Handle Range Requests for proper media file handling ([#298](#298)) ([6f18248](6f18248)), closes [#248](#248) [#205](#205) [#141](#141)
@Ionitron
Copy link
Collaborator

Ionitron commented Feb 4, 2019

🎉 This issue has been resolved in version 3.1.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

@yelhouti
Copy link
Author

@jcesarmobile support is broken, full stream is returned instead of correct range. please fix this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
5 participants