Skip to content

Chromecast a canvas #27

@un33k

Description

@un33k

[x] Feature request

Ask: Possibility of a casting a canvas.

Info:

<canvas></canvas>
is very powerful and it would be great if the possibility of casting the canvas is added.
// REF: https://developers.google.com/web/updates/2016/10/capture-stream
const canvas = document.querySelector('canvas');
const video = document.querySelector('video');

// Optional frames per second argument.
const stream = canvas.captureStream(25);
// Set the source of the <video> element to be the stream from the <canvas>.
video.srcObject = stream;

Now, the `<video></video>` tag should be available for casting. 

Gotcha!:
Capturing the MediaInfo needs to work, and I think the following might do it.

const mediaInfo = new this.cast.media.MediaInfo(video.currentSrc);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions