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 are not seekable (WebViewAssetLoader needs to support range requests) #1494

Open
3 tasks done
AshleyScirra opened this issue Sep 20, 2022 · 1 comment
Open
3 tasks done

Comments

@AshleyScirra
Copy link

Bug Report

Problem

Videos in cordova-android are not seekable, apparently since the introduction of WebViewAssetLoader in v10.

Sample Cordova project:
TestVideo.zip

When built and run on a device, touch the red circle to play a video. Touch the orange bar to seek to 10 seconds (this sets currentTime on the HTMLVideoElement).

What is expected to happen?

Video to seek to 10 second point in video.

What does actually happen?

Video restarts.

Information

I believe the problem is that WebViewAssetLoader returns 200 OK for all responses.

However Chrome can't allow media elements to be seekable unless the "server" supports range requests. This is of course designed to work over the network, but even though the resources are all local, it still must correctly handle range requests in order to allow media to be seekable. So I think if WebViewAssetLoader serves range requests as expected it will fix this problem.

I'm not sure if the API is the same but this fix from the Ionic team looks relevant: ionic-team/cordova-plugin-ionic-webview#298

Command or Code

Build and run provided Cordova project on an Android device.

Environment, Platform, Device

Tested on Asus ZenFone 8 with Android 12. Also reported to happen on Samsung S5e Tablet (see Scirra/Construct-bugs#6122).

Version information

Cordova Android v11.0.0

Checklist

  • I searched for existing GitHub issues
  • I updated all Cordova tooling to most recent version
  • I included all the necessary information above
@jcesarmobile
Copy link
Member

Cordova-android doesn’t use the same API, it doesn’t handle the requests directly, it uses WebViewAssetLoader https://developer.android.com/reference/androidx/webkit/WebViewAssetLoader
so should be the google team in charge of that package the ones who should fix it.

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

No branches or pull requests

2 participants