obsproject / obsproject/obs-browser

image "error" event does not work on OBS but it does work on regular chrome

Open
#83 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
904
Forks
267
Avg merge
1d 23h
Merged PRs (30d)
2

Description

Tried to do a simple slideshow that I could use as a browser source on my stream. It would show every image within a folder, it would keep looping until it tries to load an image that does not exist, then goes back to the first one.

Chrome does show file not found error for local images:
image

I used an eventListener to look for when this happens:

selector.img.addEventListener("error", function () {
        console.log("error");
    });

And it works just as intended, it goes back to first image, no problems. Except when using BrowserSource. It goes to the last image but it won't fire the image "error" event.

Also, logging in with the remote debugger on OBS does not log any file not found
image
I've used both "load" and "error", but only "load" seems to work. Was this purposefully removed or is it unintended?

Contributor guide

No contributing guide indexed for this repository

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 by reproducing the missing-image case in OBS BrowserSource and compare it with regular Chrome, using the remote debugger mentioned in the report. Done means the JavaScript image error listener fires for a nonexistent local image in BrowserSource and the failure is visible in the debugger.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
desktop, web-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.