- From: Aymeric Vitte <vitteaymeric@gmail.com>
- Date: Wed, 11 Jun 2014 20:02:24 +0200
- To: public-html-media@w3.org
Apparently I can not comment the bug reports, I don't get the use case
too here and the benefit/use of the worker as well as the interaction
between the worker and the parent.
Regards
Aymeric
Le 11/06/2014 16:14, bugzilla@jessica.w3.org a écrit :
> https://www.w3.org/Bugs/Public/show_bug.cgi?id=26060
>
> Bug ID: 26060
> Summary: Media Source and Web Worker
> Product: HTML WG
> Version: unspecified
> Hardware: All
> OS: All
> Status: NEW
> Severity: normal
> Priority: P2
> Component: Media Source Extensions
> Assignee: adrianba@microsoft.com
> Reporter: saran@exaeone.com
> QA Contact: public-html-bugzilla@w3.org
> CC: mike@w3.org, public-html-media@w3.org
>
> One possible use case scenario for the Media Source Extension is to construct a
> live video stream. In an effort to keep latency low, one may decide to make the
> media segments very small but have them arrive very frequently. This has the
> potential to cause the main thread to block and become unresponsive.
>
> In order to alleviate this, it would be useful to be able to create the
> MediaSource object in a Worker running in a separate thread, and send its Blob
> URI back to the parent script.
>
> As an example, with still images it is currently possible to do the following
> with XMLHttpRequest. The same technique may also be useful in the MediaSource
> scenario using WebSockets (which are already available in Workers).
>
> ----------
> main.js
> ----------
> var worker = new Worker('worker.js');
> var img;
>
> window.onload = function (event) {
> img = document.getElementById('img');
> worker.postMessage('bh.jpg');
> }
>
> worker.onmessage = function (event) {
> img.src = event.data;
> }
> ----------
>
> ----------
> worker.js
> ----------
> var xhr = new XMLHttpRequest();
> var ms = new MediaSource();
>
> onmessage = function (event) {
> xhr.open('GET', event.data, true);
> xhr.responseType = 'blob';
> xhr.send();
> }
>
> xhr.onload = function (event) {
> postMessage(URL.createObjectURL(xhr.response));
> }
> ----------
>
--
Peersm : http://www.peersm.com
node-Tor : https://www.github.com/Ayms/node-Tor
GitHub : https://www.github.com/Ayms
Received on Wednesday, 11 June 2014 18:02:53 UTC