Closed Bug 1535615 Opened 5 years ago Closed 5 years ago

Expose videoId of MediaElement

Categories

(GeckoView :: Media, enhancement)

Unspecified
All
enhancement
Not set
normal

Tracking

(Not tracked)

RESOLVED WONTFIX

People

(Reporter: sebastian, Unassigned)

References

Details

In AC we are wrapping MediaElement and keeping a list of those media elements. It would be super helpful if we could expose "videoId" from MediaElement. That would help us manage them (e.g. when having to remove one) - like GeckoSession does internally too.

(In reply to Sebastian Kaspari (:sebastian; :pocmo) from comment #0)

In AC we are wrapping MediaElement and keeping a list of those media elements. It would be super helpful if we could expose "videoId" from MediaElement. That would help us manage them (e.g. when having to remove one) - like GeckoSession does internally too.

Apparently the id is just an index[1], so it's probably not too useful. You can just use reference equality, right? We should also make equals() work.

[1] https://searchfox.org/mozilla-central/source/mobile/android/chrome/geckoview/GeckoViewMediaChild.js#152

Flags: needinfo?(s.kaspari)

Apparently the id is just an index[1], so it's probably not too useful

But you seem to use the id internally also to keep and update a list?
https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#760-779

You can just use reference equality, right?

In theory yes.

Although it's a bit more complicated since we wrap that MediaElement in a generic Media state object.

We should also make equals() work.

How do you plan to do that without any state (except the id) in MediaElement?

Flags: needinfo?(s.kaspari)

(In reply to Sebastian Kaspari (:sebastian; :pocmo) from comment #2)

Apparently the id is just an index[1], so it's probably not too useful

But you seem to use the id internally also to keep and update a list?
https://searchfox.org/mozilla-central/source/mobile/android/geckoview/src/main/java/org/mozilla/geckoview/GeckoSession.java#760-779

You can just use reference equality, right?

In theory yes.

Although it's a bit more complicated since we wrap that MediaElement in a generic Media state object.

In that case you could make equals() work on your wrapper and make it use ref equality for the interior MediaElement instance.

We should also make equals() work.

How do you plan to do that without any state (except the id) in MediaElement?

We'd probably need to make the id more useful and then rely on that. The point I was trying to make is that you shouldn't need the id anyway if we're doing the right thing.

No longer needed.

Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → WONTFIX

Moving some media bugs to the new GeckoView::Media component.

Component: General → Media
You need to log in before you can comment on or make changes to this bug.