wordpress-mobile / wordpress-mobile/WordPress-Android

Missing video preview placeholder sometimes when rendering in a webview.

Open
#13,589 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

[Status] Stale [Type] Bug [Type] Task Media
Dominant language
Kotlin
Stars
3.2k
Forks
1.4k
Avg merge
1d 11h
Merged PRs (30d)
69

Description

This was created as a reminder task after this PR comment to further investigate the reason why around 7 months ago we started seeing crashes (better documented in this issue), related to the WebView rendering of videos missing the preview generated from the video and attempting to use a default video poster that eventually could be null (hence the crash).

NOTE: this can eventually happen wherever we use the WebChromeClient (see #13515 description for more context). The crash is hopefully avoided based on the above mentioned PR but probably good to better understand when/how it was introduced)

Expected behavior

When rendering a video in a webview I would expect to see the preview of the video taken from the video itself.

Actual behavior

When rendering a video in a webview sometimes (not always, see this comment for context) the default video poster is used instead of the preview generated from the video source.

Steps to reproduce the behavior

Considering one of the following scenarios, use a device or EMU with API 23 (I could reproduce also with API 28 and 29, but it's not fully clear the relation with API since sometimes has been reported it worked, see this comment ):

  1. WPWebChromeClient: used by WPWebViewActivity. This is when asking for VIEW/PREVIEW of a post containing a video from the posts list or the editor.
  2. ReaderVideoViewerActivity: this is when tapping on play button on a video from a post card in the main reader streams (like Following or Discover).
  3. ReaderWebChromeClient: used by ReaderWebView. This is when opening a post details with a video from the reader.
  • Try to visualize a post with a video
  • See the default video poster placeholder is visualized

image

Tested on [Pixel 3 EMU], Android [28], WPAndroid [#13515 PR]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with WPWebChromeClient, ReaderVideoViewerActivity, and ReaderWebChromeClient, then read PR #13515 and issue #11791 for the WebView crash context. Reproduce the missing preview on the listed Android API levels and determine when the default poster is selected instead; the investigation is done when the cause and affected entry points are identified and the video preview behavior is corrected.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.