My Android app plays videos within the app using a videoView. When connecting the tablet to a TV using HDMI, I am able to see my tablets screen on the TV.
Everything seems to be working fine, however in my app, my videoView is ONLY displayed on the TV. The tablet is just blank. Is there a way to force the videoView to play the video on both the TV and the tablet? I want both screens to be identical.
HDMI out is not part of the Android SDK, and in many cases is not even really a part of the standard Android OS. Device manufacturers can do what they want in terms of what is shown on the tablet and what is shown on the TV. There is nothing on VideoView or MediaPlayer to control this behavior.
If you are targeting some specific piece of hardware, you can try contacting the manufacturer to see if they have some beyond-the-SDK way of controlling this.
Related
I am testing a simple webrtc application and for that I do a video call using a browser. I have setup an emulator running Android R (10.0+) emulating Pixel 3 with 4 GB of ram and 6 GB of hard drive space. I made a call using the application between the emulator and the desktop, using chrome on both devices, and I got a black screen for participant's video on both screens. I used the parameter document.getElementsByTagName('video').readyState and document.getElementsByTagName('video').networkState and I got a value of 0 or no data for readystate and, a value of 2 or loading for the networkState. I tried the same setup with a different emulator (Pixel with Android Q) and checked the same parameter, and I had no issues. I was able to see the video from both participants. Can anyone help me out?
Edit: Actually I just figured this out. If you go in and remove "OMX.google" from https://chromium.googlesource.com/external/webrtc/+/HEAD/sdk/android/src/java/org/webrtc/MediaCodecUtils.java#33 and make a custom build of webtc that should allow playback in API 28 and below emulators. Am working on getting it for 29 and above soon.
The Android emulator will show a blank screen with h264 video, since webrtc for Android does not enable h264 hardware encoding/decoding by default. You will need to use a physical device or build webrtc to use h264 software encoding/decoding. AFAIK this is the best guide to do that. You will need to translate it from Chinese. Keep in mind that this quirk also causes the video to show as blank on devices without the appropriate hardware (generally a Qualcomm or Exynos chipset)
I am developing an advertisement application which plays multiple videos. I have faced a very strange problem: nor the simple Video nor the StageVideo are not visible when I run the app on target android device. Even FLVPlayback is not visible.
I can hear the audio but the only way to get the video is to press back button and then get back to app. In this case the video is displayed on the top of the rest display objects. This happens only on a target device which is a chinese sibo android tablet. It has android 4.1 on board. As I see a lot of people had the similar issue with different devices:
http://forums.adobe.com/message/5429125
but the solution they have mentioned there -adding true to the manifest xml doesn't fix my issue.
Adobe also advises to do it
http://forums.adobe.com/message/4914005
I am using adobe air 4.0 sdk and the air 4.0 runtime on the device. I have tried to change renderMode to CPU/Direct/Auto but it doesn change anything.
The other three android devices I have - toshiba thrive tablet(4.0.4)/ eken tablet(4.2.2)/ htc desire c smartphone(4.0.3) play all the video content just fine.
I guess the problem is re: their custom firmware(it auto hides all system bars..etc in order to make it work in 'kiosk' mode) but wanted to try all the variants before give up on this.
Any advice will be highly appreciated.
Thanks,
Max
After hours of scouring I did find a solution for AIR 4.6.0.
add backgroundAlpha to application node in the FLEX xml:
<s:Application backgroundAlpha="0.0" ... >
in the app.xml, change the namespace to highest version (3.7)
<application xmlns="http://ns.adobe.com/air/application/3.7">
and under the <android> node, add this
<containsVideo>false</containsVideo>
these are the references I found:
https://community.adobe.com/t5/flash-player/12-11-2012-air-3-5-runtime-and-sdk-update/td-p/4661723
https://help.adobe.com/en_US/air/build/WSfffb011ac560372f2fea1812938a6e463-8000.html#WS1B1ABBB6-F1D9-43f0-BC3E-0135F15FFAC4
No video when using spark VideoPlayer AS3
https://issues.apache.org/jira/browse/FLEX-33856
https://issues.apache.org/jira/browse/FLEX-33896
I have found a way how to force this unfriendly tablet to play the video in Adobe Air app by encoding it into FLV format and then embedding it into a swf via Flash pro. In this case I had to sync the app and video framerate(24fps). I have also set usingVideo flag to false in app descriptor.
Playback quality and performance are not very good but it's the only working method at the moment - I guess those can be improved by tweaking flv encoder params.
Update 4/3/2014
As the video playback embedded into swf was awful on the target device I have decided to download all the android versions of air runtimes starting from 3.1 and test normal video playback on these. Finally I have got the following results:
3.1.0.557 - NO
3.2 - YES
3.3.0.365 - YES
3.4.0.254 - NO
3.5.0.60 - NO
3.6.0.609 - NO
3.7.0.186 - NO
3.8.0.147 - NO
3.9.0.141 - NO
4.0 - NO
In the end I have found the solution - I have uninstalled all modern versions downloaded from google play and installed 3.3.0.365. I think my experience can be useful for those who develop AIR apps for android where target devices are noname low-end android tablets.
PS. I found another possibility to make video playing by using an swf embedded into an html page and displayed by StageWebView but this method has so much obstacles(FP security rules, ExternallInterface barriers) so it has no sense to implement it.
So I am having issues with the Vimeo player on an Android device (Samsung Galaxy S3) running Android 4.1.
In the web browser it seems that the Android OS web browser turns the iFrame into a native HTML5 player once the video starts. This seems to render the Froogaloop API useless.
An example can be seen here: http://www.dmns.org/science/museum-scientists/chip-colwell-chanthaphonh/mobile .
Click on the 'Videos' tab and click on the Next and Previous arrows. The arrows should stop the videos.
Those should 'unload' or stop/pause the video but they does not. It works on desktops fine and older Android devices, but the new Android 4.1 OS the player does not stop when the arrows are selected.
Note: I have not downloaded Flash for Android and don't want to.
If you have a solution or any suggestions to try that would help tremendously. Thanks in advance.
We are using PhoneGap/Cordova 1.8.1 (Android) with the latest version of the ChildBrowser plugin. When we bring up a link to youtube in the ChildBrowser, we generally cannot play any videos. Here is our testing so far:
Android 2 (old Droid 1): Mobile YouTube site comes up, no videos will play at all though (doesn't even switch to video mode).
Android 4 (Motorola Xoom): Mobile site comes up, video seems like it is playing, but only shows a black screen (no sound);
Android 4 (Droid Razr Maxx): Mobile site comes up, plays, but no video only sound.
We also had someone report with an Android 2 device that the video would play, but would change the orientation of the device from portrait to landscape - then upon going back to the app the app would stay fixed in landscape (even though it is set to portrait only).
Yes, you should use the ChildBrowser.openExternal on Android as it will start the Android browser which you can play YouTube video's. The ChildBrowser.showWebPage does not start the browser, instead it creates it's own web view to display the remote side so it is not full featured.
I have an application that uses the ViewFlipper and the built in animation for PageIn and PageOut and I don't see any animations occurring on my GOOGE TV. Phones and tablets all work, but animations are not showing on my GOOGLE TV logitech box or Sony GOOGLE TV box.
My app is a photo/video slideshow photo book type viewer, so we're using the resources of the device, but still have no issues on the phone. I'm running a sony and a logitech and same results.
The same code base works perfectly on Honeycomb and the phone. Has anyone else seen very jerky performance in your apps that do a ton of Bitmap decoding and usage?
Turns out that Hardware Acceleration isn't enabled in the current builds of Honeycomb for Google TV. That is the cause of the issue.
The sample code http://www.warriorpoint.com/blog/2009/05/26/android-switching-screens-in-an-activity-with-animations-using-viewflipper/ shows Page in/out animation on Sony devices. Are you doing something different on your side?
It seems that the animations on GTV need some time to warm up before they're ready to perform smoothly. Try putting a small delay at the beginning of your animation.
android:startOffset="1500"
It will kill your responsiveness, but that's acceptable for our purposes because we're using it during an automatic slideshow.
Been working on a similar project on GoogleTV and it is now open-source:
https://github.com/elsewhat/com.elsewhat.android.slideshow
I use Gallery as the key component, but had performance problems on large screens with GoogleTV and the "swipe" transition Gallery uses. Been in touch with people from GoogleTV product management, and we were unable to find a solution for the root cause.
Ended up with combining the Gallery with a ViewAnimator to fake a fade-out/fade-in effect and performance is on longer an issue.