home-assistant / home-assistant/android

`video` element from camera not in focus

Open
#7,355 3 comments 0 reactions 0 assignees View on GitHub
bug webview
Dominant language
Kotlin
Stars
3.9k
Forks
1.1k
Avg merge
1d 12h
Merged PRs (30d)
81

Description

**Home Assistant Android app version(s):**

2026.6.5-full

**Android version(s):**

12

**Device model(s):**

Galaxy S10e

**Home Assistant version:**

2026.5.4

**Last working Home Assistant release (if known):**

**Description of problem, include YAML if issue is related to notifications:**

Sorry in advance if the issue is not with the app.
I am trying to debug why the barcode reader implemented in https://github.com/blaineventurine/simple-inventory-card is not properly focusing.

The reason i suspect the app's WebView being involved is that the the camera stream works fine if i open it from the browser (both on desktop with a webcam and on the phone) but from the app i get a blurry image (still visible but not focused enough for the barcode reader to do its job).

i repost here my attempt to debug this from https://github.com/blaineventurine/simple-inventory-card/issues/59#issuecomment-5357595447 where i see that in the `videoElement.srcObject.getVideoTracks()[0].getCapabilities()` only the `manual` is advertised as a `focusMode`

video element details

```
> ({
resolution: [$0.videoWidth, $0.videoHeight],
settings: $0.srcObject.getVideoTracks()[0].getSettings()
})

{
"resolution": [
1080,
1920
],
"settings": {
"aspectRatio": 0.5625,
"colorTemperature": 0,
"deviceId": "33732aea93b8dfdcccc4e12808ee6ab86afa7c2e2053e867ebd89448ccdb8750",
"exposureCompensation": 0,
"exposureMode": "continuous",
"exposureTime": 0,
"facingMode": "environment",
"focusDistance": 0,
"focusMode": "continuous",
"frameRate": 10,
"groupId": "58cbef99395df8b9e30ed27dabca4efdda44e98993409325d3d2687ea8eb7802",
"height": 1920,
"iso": 0,
"resizeMode": "none",
"whiteBalanceMode": "continuous",
"width": 1080
}
}
```


video element capabilities

```
> $0.srcObject.getVideoTracks()[0].getCapabilities()

{
"aspectRatio": {
"max": 4608,
"min": 0.00028935185185185184
},
"colorTemperature": {
"max": 7000,
"min": 2850,
"step": 50
},
"deviceId": "444a21636d3ee0d41f1e2325d24b610c9b4876400035bdd1655287370ac706dc",
"exposureCompensation": {
"max": 2,
"min": -2,
"step": 0.10000000149011612
},
"exposureMode": [
"continuous",
"manual"
],
"exposureTime": {
"max": 1000,
"min": 0.6,
"step": 0.1
},
"facingMode": [
"environment"
],
"focusDistance": {
"max": 9223372036854776000,
"min": 0,
"step": 0.009999999776482582
},
"focusMode": [
"manual"
],
"frameRate": {
"max": 60,
"min": 0
},
"groupId": "13c7b9cbaef3bbc60a4de22ab4a4cb322e57771aa50cac086b4b07add6359e4b",
"height": {
"max": 3456,
"min": 1
},
"iso": {
"max": 800,
"min": 40,
"step": 1
},
"resizeMode": [
"none",
"crop-and-scale"
],
"whiteBalanceMode": [
"continuous",
"manual"
],
"width": {
"max": 4608,
"min": 1
}
}
```


**Companion App Logs:**

**Screenshot or video of problem:**

**Additional information:**

Contributor guide

Open the contributing guide

Research direction

Reproduce the blurry camera stream in the Android app's WebView on Android 12 using the Galaxy S10e, then compare it with the browser behavior. Inspect the video element's getSettings() and getCapabilities(), especially focusMode, to determine whether the app exposes the focus behavior needed by the barcode reader. Done means the camera stream focuses sufficiently for simple-inventory-card barcode scanning.

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
Active
Clarity
Needs clarification
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.