googlearchive / vrview

Library for embedding immersive media into traditional websites.
http://developers.google.com/cardboard/vrview
Apache License 2.0
1.71k stars 1.09k forks source link

Get video element from vrview #184

Closed Steffen1986 closed 7 years ago

Steffen1986 commented 7 years ago

Hello,

i am trying to capture a single image from a paused mp4 video using canvas and context.drawimage method. I load my video in the following way:

vrView = new VRView.Player('#vrview', { width: '100%', height: 480, video: 'test.mp4', is_stereo: false, loop: false, //is_debug: true, //default_heading: 90, //is_yaw_only: true, //is_vr_off: true, });

Any ideas how to access the video of the "vrView"?

Steffen

lincolnfrog commented 7 years ago

The video is part of a element (inside the iframe if using the vrview.js). Using the method described here to capture: https://developers.google.com/web/updates/2016/10/capture-stream.

Some code: vrView.on('ready', () => { var iframeCanvas = vrView.iframe.contentDocument.getElementsByTagName('canvas')[0]; var captureStream = iframeCanvas.captureStream(25); });