This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 18591 - addsourcebuffer and removesourcebuffer events appear unhelpful
Summary: addsourcebuffer and removesourcebuffer events appear unhelpful
Status: VERIFIED FIXED
Alias: None
Product: HTML WG
Classification: Unclassified
Component: Media Source Extensions (show other bugs)
Version: unspecified
Hardware: PC Linux
: P2 normal
Target Milestone: ---
Assignee: Aaron Colwell (c)
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-08-16 14:02 UTC by Philip Jägenstedt
Modified: 2012-08-23 08:37 UTC (History)
3 users (show)

See Also:


Attachments

Description Philip Jägenstedt 2012-08-16 14:02:03 UTC
http://dvcs.w3.org/hg/html-media/raw-file/tip/media-source/media-source.html#sourcebufferlist-events

The addsourcebuffer and removesourcebuffer events are fired when:

* addSourceBuffer: "Add the new object to sourceBuffers and fire a addsourcebuffer on that object." (Ambiguous which the target object is, but presumably sourceBuffers.)

* removeSourceBuffer: "If sourceBuffer is in activeSourceBuffers, then remove it from that list and fire a removesourcebuffer event on that object." and "Remove sourceBuffer from sourceBuffers and fire a removesourcebuffer event on that object."

* Detaching from a media element: "Remove all the SourceBuffer objects from sourceBuffers and fire a removesourcebuffer event for each one."

What is the use case for these events? Since the application is the only source of added or removed buffers, telling the application about it appears very strange.

It looks like this API may have taken inspiration from HTML's TextTrackList, but the reason there are addtrack and removetrack events in that context is that the application needs to be notified about in-band tracks, i.e. an external source of events.
Comment 1 Aaron Colwell (c) 2012-08-17 21:12:55 UTC
You are right, these events were inspired by TextTrackList. The primary reason I added them was for monitoring activeSourceBuffers. This list gets modified by the UA when tracks enabled/selected state changes. A web application might want to monitor changes to this list so it can stop fetching media for inactive SourceBuffers.

I agree the targets need to be fixed and I'll fix that in response the the broader event targets bug you filed.
Comment 2 Philip Jägenstedt 2012-08-20 08:49:52 UTC
(In reply to comment #1)
> You are right, these events were inspired by TextTrackList. The primary reason
> I added them was for monitoring activeSourceBuffers. This list gets modified by
> the UA when tracks enabled/selected state changes. A web application might want
> to monitor changes to this list so it can stop fetching media for inactive
> SourceBuffers.

Oh right, I overlooked that.

> I agree the targets need to be fixed and I'll fix that in response the the
> broader event targets bug you filed.

Great!
Comment 3 Aaron Colwell (c) 2012-08-22 23:40:46 UTC
I decided to updated these specific event targets before tackling all the rest.
http://dvcs.w3.org/hg/html-media/rev/340786fcae83