Why is Three.js video not rendering on my Nexus 7 - android

Trying to run the Three.js examples on the Nexus 7 and most of them work fine.
But im particularly interested in getting webgl video rendering to work on my nexus 7 device and this doesn't seem to work. All im getting is a black screen where the video is supposed to render, the rest surrounding the video renders just as normal.
My Nexus 7 is running android 4.4.4 & Chrome 36.0.1985.135 and im not seeing any console errors when running these examples.
The examples that don't work are:
https://github.com/mrdoob/three.js/blob/master/examples/canvas_materials_video.html
https://github.com/mrdoob/three.js/blob/master/examples/webgl_materials_video.html
My assumption (and from what i read) is that this could have something to do with the texture size, its needs to be the power of 2. Do you guys have any clue on why its not working and what i could try to get it working?
Many thanks for your help already
Best,
Erik

I'm just guessing but AFAIK videos don't autoplay on mobile devices. To fix the issue you need to make the user click something and in the handler for that click start the video playing. The easiest way might be to make a fullscreen div with no content that has its css z-index set to something so it's above everything else. Once the user clicks it start the video and remove it.

Related

When StageVideo is being rendered by software, black screen and audio only on Android. When hardware accelerated, everything works

We developed an Android app using Adobe AIR. We basically loop HD and FullHD H.264 videos using the StageVideo resource, that takes benefit from hardware acceleration.
This app is running perfectly on our Yarvik Noble tablet and on our Tronsmart MK908. On the Vega sometimes we get a black screen with audio, but on some other times it works perfectly. There is no pattern or specific video, it sometimes happens and then gets back to normal.
We did some other tests and found out that the Vega swaps between HARDWARE ACCELERATION (works perfectly) and SOFTWARE (black screen with audio). The strange thing about it is that the same video sometimes is decoded in one way and some other times in the other way.
Meanwhile our other hardwares always decode the vĂ­deos using HARDWARE ACCELERATION.
I shot a small video showing the problem. As soon the app is opened, the video on the tablet (muted) is perfectly displayed while the TV (not muted) displays a black screen and just the audio. A very curious fact is that there is no pattern to repeat the problem. Sometimes the first video works and other videos fail.
Video - http://hahmann.com.br/air/IMG_7104.mp4
All the Vega S89 units we own are Android 4.4.2, Build 108k4 and Kernel 3.10.33.
Apk and source - http://hahmann.com.br/air/source_apk.zip
Bug opened at Adobe - bugbase.adobe.com/index.cfm?event=bug&id=3836848
I appreciate some help.
Best Regards,
Peter

The behavior of animated gif in WebView is very strange!!, how to fix this?

I have an application with a WebView, where there's a long list of posts that Autoloads via Ajax when the user approaches the bottom of the scrollable area, so I display the word "Loading ... " and an animated GIF beside it created via Ajax Loader site.
The problem is that this Gif sometimes appear as a still image in some devices with Androind 2.3.5/2.3.6, and in other devices its animation is extremely fast, and in other devices it's extremely slow.
E.g. Galaxy S Mini with OS: 2.3.6 (it appears as a still image).
Galaxy S I9003 with OS: 2.3.6 (it plays in a very very fast rate).
Galaxy S2 with OS: 4.0.3 (It plays very fast then suddenly becomes extremely slow but it's still animating).
Is there a standard frame rate or any work-around for this issue ?,
Here's the image That I'm using:
------> <--------
I know Facebook's app was using WebView with loader at the bottom of the feed but I don't know if it was animated gif or not.
I know that older versions of Android didn't support animated GIFs but I'm talking about new version
I had exactly the same problem and found no solutions! Animated GIF behavior seems really inconsistent across devices. That's the bad news. The good news is that I've made a work around, specifically for ajax loaders like yours.
You'll need to make separate image files for each frame of your GIF. It sounds horrible but it worked out ok for me - My 8 frame 8kb GIF turned into 8 png images totaling 11kb, and I got the bonus of 8bit transparency so I don't have to worry about the background color. It does mean the client has to make extra requests for the separate images though, so the fewer frames the better. I called the images 0.png, 1.png ... 7.png and put them in a folder to keep them neat.
Now the code! I'll explain it below.
HTML:
<img src="images/loader/0.png" id="headLoader" />
<div id="loaderKicker" style="visibility:hidden;"></div>
JavaScript (jQuery):
var loaderImg = $("#headLoader");
var loaderProg = 0;
setInterval(function() {
$("#loaderKicker").html(loaderProg);
loaderImg.attr("src", "images/loader/"+loaderProg+".png");
loaderProg = (loaderProg+1)%8;
}, 300);
First we have the img that we will animate. We use setInterval to change the image url to cycle through the frames. Really short intervals obviously put load on the device so we don't want to go nuts. I have a really cheap Android 2.2 device and 200ms+ intervals seem to work ok without wrecking app performance.
The loaderKicker div is there to make this work on older devices (like the ones we're targeting :) ). Android seems to ignore the calls when all we do is update an image url, so we get around this by updating the contents of a hidden div. I tried always updating with an "x" but it seems that the content has to actually be different. The slide number works well.
So that's it! It's a bit of a hack job but it works on everything I've tested on (Android 2.2, 2.3, 4.0, iOS6, Firefox, IE, Chrome) and if you're only doing it on one ajax loader that you'll then use everywhere it seems ok.
The other, completely separate, solution is to animate the image using HTML5 canvases but I couldn't tell you anything about support for them in old devices.

Galaxy S3 Video Recording via API "rolls" or is corrupted in Bright Light

Following the instructions from Google here exactly as it is (QUALITY_HIGH):
http://developer.android.com/guide/topics/media/camera.html#custom-camera
When doing this with a Galaxy S3 (US Version) everything seems fine in indoor lighting. But when the camera goes outside and it is bright (maybe it needs to increase the shutter speed) something strange happens. The video starts "rolling" like a bad TV signal, and the image gets to be very low quality. It almost seems like the image sensor got overloaded and messed up.
I tried recording with the normal camera application and it seems to have no problems under the same condition. But using the API as described here generates this problem. Since the S3 is pretty popular -- anyone run into this problem before?
Is there some kind of hidden setting that the main camera app uses for camera setup? I tried flattening the camera settings to take a look at what's in there and there are tons of settings but i dont know what they all do without documentation. already tried turning off anti-banding and luma-adaptation and that didnt seem to do anything.
Thanks!
I think I figured it out. Need more testing but this seems to do it. There is a hidden setting called "camera-mode" that is normally set to -1. I changed it to a 1 and suddenly it is fine and functioning like the normal camera app.. anyone know what this mode thing actually means?
Camera.Parameters lParam = prCamera.getParameters();
lParam.set("camera-mode",1);
prCamera.setParameters(lParam);
Is what did the trick if anyone else seems to run into the problem.\

Android SurfaceView black screen on Galaxy S

Hi I am wondering what the problem with the galaxy S is. I am using both a nexus S and a galaxy S phones for testing purposes. My whole app works pretty well on Nexus one. But when it comes to Galaxy S I cant see any video. Just hear audio.
Like I said above this doesn't happen on Nexus S. Is there something about the Galaxy S that messes with the SurfaceView? Sometimes I get a quick flash of the video before the screen goes black. My menu's and such still show up just not the video. Any help would be greatly appreciated. If you have know how to fix this kind of problem please help. I will add relevant code if necessary
I know for a fact that the video is playing because in one of the methods that stats the video player i put a logcat which tells me that video is starting to play.
Is it possible that the surface view is being hidden for some reason on the galaxy S?
I'm not sure if this is relevant to you, but i had a similar issue with image assets not displaying on this phone, turns out i needed to use the layout-xhdpi, even though all other phones would default to the standard image in the 'layout' directory
I finally figured out what the Problem was. I am changing some settings in for the aspect ratio. This somehow stops the image from showing up. I will update when i have found a solution.
Edit:
I call setAspectRatio on my my Video after it has been prepared and the video has started in the onPreparedListener.
Edit 2:
The best way around this error is to change the aspect Ration after VideSizeChanged listener is called the first time, as that is when the first dimensions of the video are found.

Android Display content through the Video-out

Does Android have the software capabilities to, if a phone has video-out, to open or push content solely to the video out.
So for example if the user is in and clicks on a YouTube link, the app, instead of opening the content on the main screen over the app it would push it to the video out so the YouTube video would display on their connect display and they could continue to browse.
I know Motorola's have the WebTop software and this idea is similar to what I am trying to accomplish but on a much more basic level. It's more similar to Apples AirPlay but much less complex again (without a network/external player - just video out).
Or if even that is to complex an even simpler solution of having the video-out still output even when the phone is locked. Currently the video-out mirroring on both my HTC Incredible and Galaxy Nexus will stop when the phone is locked.
EDIT:
I've noticed while using my phone that playing a video through the Google Videos app that on the phone controls will overlay on the screen i.e. play, pause, seek bar, and, the soft buttons, but the video-out display (Television) plays the video continuously/seamlessly without any of the controls over-layed. Now this is very primitive example of what i'm ultimately alluding too but it does show a real world example of an android device (no 3rd party manufacture software) doing video out that isn't exactly mirroring.
Well... I hate to furnish this as an answer, but it really looks like there's simply nothing in the API for it at all...
http://groups.google.com/group/android-developers/browse_thread/thread/9e3bcd1eea2c379
which just redirects to:
https://groups.google.com/forum/#!topic/android-developers/Jxp_9ZtzL60
I'm definitely going to favorite this question, and hope someone chimes in with something more useful than a "doesn't look like it's possible, though that does appear to be the correct answer, at this time.
Much like Dr.Dredel has mentioned, there is nothing current for multiple displays in terms of display 1 showing 'A' and display 2 showing 'B'
There is support for multiple screen sizes per the following:
http://developer.android.com/guide/practices/screens_support.html#support
This will be the case for a little while longer until someone creates the support for it.

Categories

Resources