We're looking to stream content in a HTML tag through a video chat service, TokBox. This content is currently housed in Salesforce Files, and we're trying to access this content via the "streamCapture()" function in a Visualforce page. The error we're getting is this:

DOMException: Failed to execute 'captureStream' on 'HTMLMediaElement': Cannot capture from element with cross-origin data.

It looks like there is a CORS issue between our page [sandboxName].visual.force.com and the location of the File [sandboxName].content.force.com, and we're looking for any possible solutions to work around this error.

Here is a code snippet showing our problem.

<apex:page showHeader="false" sidebar="false">
            <video id="testVideo" src="/sfc/servlet.shepherd/version/download/0684C000000TgYCQA0" type="video/mp4" controls="controls" height="100" >
            <script type="text/javascript">
               var streamCapture = document.getElementById("testVideo").captureStream();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.