Skip to content

Commit

Permalink
- Added exception when material.src exists but === "" (boxes example)…
Browse files Browse the repository at this point in the history
… in aframe 0.5.0

- Bumped aframe + component version
  • Loading branch information
oscarmarinmiro committed Mar 9, 2017
1 parent 372ab15 commit c91a4b0
Show file tree
Hide file tree
Showing 5 changed files with 64,314 additions and 52,516 deletions.
16 changes: 11 additions & 5 deletions dist/aframe-stereo-component.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,18 @@
// Check if material is a video from html tag (object3D.material.map instanceof THREE.VideoTexture does not
// always work

if(this.el.getAttribute("material")!==null
&& 'src' in this.el.getAttribute("material")
&& document.querySelector(this.el.getAttribute("material").src)!== null
&& document.querySelector(this.el.getAttribute("material").src).tagName === "VIDEO"){

if(this.el.getAttribute("material")!==null && 'src' in this.el.getAttribute("material") && this.el.getAttribute("material").src !== "") {
var src = this.el.getAttribute("material").src;
// If src is a string, treat it like a selector, for aframe <= v0.3
if ((toString.call(src) == '[object String]'
&& document.querySelector(src) !== null
&& document.querySelector(src).tagName === "VIDEO")
||
// If src is a video element , just get the tagName
('tagName' in src
&& src.tagName === "VIDEO")) {
this.material_is_a_video = true;
}
}

var object3D = this.el.object3D.children[0];
Expand Down
2 changes: 1 addition & 1 deletion dist/aframe-stereo-component.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit c91a4b0

Please sign in to comment.