Comments (11)
Make sure you .play()
it after makeVideoPlayableInline
is called. To debug it you'll need to figure out what those script error.
are
from iphone-inline-video.
Thanks I've had another attempt at this and it's kind of half working - I don't get a pop up and I can hear the video sound.
However as soon as the Three.js mesh with the video gets added to the scene I get constant 'script errors' that appear to show every time it tries to render the scene.
If I use any of
var video = document.querySelector('video');
makeVideoPlayableInline(video);
Or the jQuery method I get
http://10.1.1.3/resources/js/beekjs/iphone-inline-video.browser.js:1link
TypeError: Attempted to assign to readonly property.
The video variable is created as such
video = document.createElement( 'video' );
video.loop = true;
video.crossOrigin = '';
video.preload = 'auto';
If I just use makeVideoPlayableInline(video) with that video variable then it's fine.
So it looks like your code isn't going to work beautifully with Three.js, have you attempted to have it work as a texture?
from iphone-inline-video.
iphone-inline-video
works with Three.js: http://bfred-it.github.io/iphone-inline-video/demo/threejs.html threex.videotexture/examples/videotexture.html
The problem is somewhere in your code. Make sure it works on the iPad first
from iphone-inline-video.
thanks that's useful. This is working fine on desktop and Android, just having massive problems on iOS.
I've been following that code and can get closer, but still can't get the video to show and as soon as it starts to play I get that script error
when it tries to render the scene.
Here's how I'm trying to do it
``` if(!video){
video = document.createElement( 'video' );
video.width = 320;
video.height = 240;
//video.autoplay = true;
video.loop = true;
video.crossOrigin = '';
video.preload = 'auto';
}
video.src = source = cdnPrefix + "/"+ sceneObject.video;
geometry = new THREE.SphereGeometry( 500, 60, 40 );
videoTexture = new THREE.Texture( video );
videoTexture.minFilter = THREE.LinearFilter;
videoTexture.magFilter = THREE.LinearFilter;
videoTexture.format = THREE.RGBFormat;
videoMaterial = new THREE.MeshBasicMaterial( { map : videoTexture } );`
` makeVideoPlayableInline(video);
video.addEventListener('canplay',function(e){console.log('CAN PLAY'); iOSVideo = true});
video.play();
showVideo();`
And in the render loop
` if ( video.readyState === video.HAVE_FUTURE_DATA )
if ( videoTexture )
videoTexture.needsUpdate = true;`
from iphone-inline-video.
This is the error I get when I console.log the video events
:0
Script error.
"@", "seeking"
"@", "seeked"
from iphone-inline-video.
"Script error" says nothing about the error, you'll have to find a better way to debug it. It might just be that Safari is triggering some security error. You'll have to ask on some support forum or StackOverflow if you still have issues because I already showed that it works.
from iphone-inline-video.
OK Thanks
from iphone-inline-video.
You mentioned that you already showed it works, is there a demo of that anywhere. http://bfred-it.github.io/threex.videotexture/examples/videotexture.html seems to be dead. Thanks!
from iphone-inline-video.
@bknill did you ever get this working?
from iphone-inline-video.
I created another demo here: http://bfred-it.github.io/iphone-inline-video/demo/threejs.html
Note that Safari doesn't support CORS on videos, so the file has to be on the same domain to make it work.
from iphone-inline-video.
That example was exactly what I needed. Thank you very very much.
from iphone-inline-video.
Related Issues (20)
- Handle autoplay state and events correctly HOT 1
- Some properties don't work in fullscreen
- Test HOT 1
- Test
- Replace ಠ with IIV? HOT 5
- Some warnings/errors when installing with npm v5.0.3 HOT 1
- [iOS] Autoplay doesn't work with css prop display:none HOT 1
- Use the iphone-inline-video with vidoe. Js HOT 1
- Would this library work on non-webGL devices? HOT 3
- It doesn't work for in-app video HOT 1
- [Deprecation] 'HTMLVideoElement.webkitDisplayingFullscreen' is deprecated. Please use 'Document.fullscreenElement' instead. HOT 4
- option to force IIV to be used on iOS 11 when in low power mode HOT 1
- vpaid enabled ? HOT 1
- Error DOMException HOT 9
- Is there a way to do this on an iframe element instead of <video>? HOT 1
- Common and es modules HOT 2
- ios11.2.5
- video.pause is not a function. in Chrome device Mode with iPhone simulations only. (React) HOT 1
- Control bar not Hidden HOT 1
- React uses enableInlineVideo to cause the ios8 and 9 devices to play video abnormally HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iphone-inline-video.