搜尋 Mozilla 技術支援網站

防止技術支援詐騙。我們絕對不會要求您撥打電話或發送簡訊,或是提供個人資訊。請用「回報濫用」功能回報可疑的行為。

了解更多

a performance trouble about canvas2d

  • 無回覆
  • 0 有這個問題
  • 14 次檢視
more options

I've got a problem about rendering `video` with `requestAnimationFrame`. It seems right and quick on Chrome ,but unresponsive and flashing at FF.

 My code looks like this (minified):

``` $video.src = "/test.mp4"; $video.play(); var context = $canvas.getContext("2d"); function render() {

 context.drawImage(video, 0, 0);
 requestAnimationFrame(render);

} render(); ```

 I think this might be the most classical way to render videos to canvas2d, and it runs well on Chrome. 
 After that, I've justified `gfx.canvas.accelerated` to `true` but nothing changed.
 Is there any way for FF to be better on this way?
I've got a problem about rendering `video` with `requestAnimationFrame`. It seems right and quick on Chrome ,but unresponsive and flashing at FF. My code looks like this (minified): ``` $video.src = "/test.mp4"; $video.play(); var context = $canvas.getContext("2d"); function render() { context.drawImage(video, 0, 0); requestAnimationFrame(render); } render(); ``` I think this might be the most classical way to render videos to canvas2d, and it runs well on Chrome. After that, I've justified `gfx.canvas.accelerated` to `true` but nothing changed. Is there any way for FF to be better on this way?