question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

crossOrigin parameter for Video

See original GitHub issue

BaseTexture.fromImage allows supplying a crossOrigin setting or defaulting to anonymous via determineCrossOrigin.

VideoBaseTexture (or Texture.fromVideo, etc.) needs a similar mechanism. Otherwise Safari (and possibly others) will block loading the video texture from a remote source.

This is not necessarily a showstopper for current production code, considering that a Video Element can be created first with the proper crossOrigin policy and then supplied, like so:

var videoElement = document.createElement('video') as HTMLVideoElement;
videoElement.crossOrigin = "anonymous";
videoElement.autoplay = true;
videoElement.src = "http://cdn.example.com/video.mp4";

var texture: PIXI.Texture = PIXI.Texture.fromVideo(videoElement);
var videoSprite = new PIXI.Sprite(texture);
SomeContainer.addChild(videoSprite);

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
AliasTcommented, Sep 7, 2017

it works! @dakom thanks

0reactions
lock[bot]commented, Feb 24, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML attribute: crossorigin - MDN Web Docs
The crossorigin content attribute on media elements is a CORS settings attribute. These attributes are enumerated, and have the following ...
Read more >
HTML <video> crossorigin Attribute
The HTML crossorigin attribute is used in the <video> element that supports a CORS request when we tried to fetch out the video...
Read more >
cross-origin video in Safari - html
Does anyone know if Safari supports crossorigin attribute on the HTML5 <video> tag? I serve video from a server that responds with all...
Read more >
HTML script crossorigin Attribute
The crossorigin attribute sets the mode of the request to an HTTP CORS Request. Web pages often make requests to load resources on...
Read more >
Cross-origin data in HTML5 Canvas
For cross-origin data in canvas, add the following attribute to the <audio? or <video> element − <img src="..." crossorigin="Anonymous" ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found