I'm using the youtube API and I did the instructions from this tutorial:
http://javatechig.com/android/youtubeplayerview-example-in-android-using-youtube-api
All is well, but when I'm not on full screen, the video keeps stopping every second. It's like it plays for 1 second, stops, then I have to press the play button again, then it will stop again after 1 second. On full screen, it plays perfectly. I'm 100% sure it's not the internet connection because I tried it with many connections and it ONLY plays properly on full screen. Any idea how I can fix this?
EDIT: It's not the phone either, I tried it on a Nexus 5, Sony Xperia z1, HTC One, a number of Samsung Galaxies. I rechecked the code multiple times, it's exactly the same, even did a copy paste of the tutorial. It still stops when it's not on full screen. I only used the tutorial, since I wanted to make sure it works before embedding it to my main project.
I solved my problem by removing the padding in the youtube video player. It now plays perfectly regardless of orientation.
Related
I have an app which plays a lot of video files. It's been all good on every phone and tablet I've tested on. I just tested on an Acer Chromebook and the first few frames (maybe up to a 1/4 second) are being dropped on all video files, so the video appears to start just slightly beyond 0. Some of the videos have audio that starts immediately and so it's obvious to the user that the video is clipped at the start. I'm wondering if anyone else has seen this issue, maybe on a Chromebook or other device and if there is some simple way to deal with it?
There is absolutely nothing fancy about my code. I'm using VideoView, preload the video with setVideoURI(), then call videoView.start() on a button press.
Thanks!
This problem only appears if I make a call to seek(0). So rather than doing that to replay the video I have to load the video each time it's requested. That workaround resolves the problem.
I want to show 4 views which will be streaming video from server. I created 4 views which are streaming video and I tested it on Nexus 7(2013), it's work fine. But when I tested on another device (Samsung Tab2) videos freezes after several minutes and some videos don't even start. It happens because MediaPlayer receives Error (100,0). I tried restart MediaPlayer when MediaPlayer.OnErrorListener receives this error, but after restarting I receive same error. This problem I have even with 2 MediaPlayers, but if I have only one MediaPlayer it's work perfect. As I understood my samsung can't work normally with more than one MediaPlayer. How can I figure out how much mediaplayers will work fine with some device? Or maybe someone faces off the same problem and can help me
It is look like Android issue http://code.google.com/p/android/issues/detail?id=17802 You could try to use other player like ExoPlayer
I have an AIR Android application which has multiple pages, each page has their own music and sound effects. Music is executed via code and the effects are part timeline and part code executed.
This all works fine on the AIR Simulator but as soon as I run it on a Tablet with Android 4.4.2 it is ok for the first page, but once the first page music and effects sound channels have been faded out (via a volume tween) you wont hear a sound from the application again. Android 4.2.2 however is fine.
I've traced the volumes and the values are fine, I've even tweened the SoundMixer volume itself and still not a sound.
The code is just basic soundmixer and soundtransform code, virtually identical to what is on adobe live docs. I've even skipped the first page and gone directly to the second to see if the sounds are working correctly and they are fine.
Anyone got any suggestions?
Issue was: omni-4.4.2-20140128
Flashed version: omni-4.4.2-20140318
and all is fine in the world once again!
The HLS streams do not play video, but they do play audio.
Device information:
Samsung Galaxy S5
Android 4.4.2 / Build KOT49H
Chrome 36.0.1985.131
HLS Streams that play on other Android builds and devices:
JWPlayer test videos do not play video:
http://www.jwplayer.com/html5/hls/
These Apple HLS streams also do not play video (but do play audio)
http://devimages.apple.com/iphone/samples/bipbopgear1.html
http://devimages.apple.com/iphone/samples/bipbopgear2.html
http://devimages.apple.com/iphone/samples/bipbopgear3.html
http://devimages.apple.com/iphone/samples/bipbopgear4.html
http://devimages.apple.com/iphone/samples/bipbopall.html
Using the browser application "Internet" on the Samsung S5, it will play the video for an HLS stream, which made me think this could possibly be an issue with Chrome, however, when tested on a Nexus 5 device with the exact same Chrome build (except Android 4.4.4) and the video plays fine.
Android Issue Queue has Issue 63810: No video in HLS live streaming on Android KitKat and I have contributed what I can.
What can I do to get more information about the nature of the problem?
Is this a legitimate bug with the Android 4.4.2 Samsung S5?
I've noticed this behavior among other issues on 4.4.2 with issues seeming to vary by device and manufacturer. Through experimentation I've noticed the following:
Entering or exiting full screen seems to reset the renderer. I suspect this forces the browser to create a new View or something
Reloading the video seems to help the renderer
Changing sources seems to make things worse
Our product works essentially on a playlist -- when the ended event triggers for one video we change the video src and call .load() and .play() to go to the next one. On some devices if the first src is HLS video plays fine, but if the first src is mp4 or webm then switching to HLS causes you to lose video. On other devices it's the opposite behavior -- starting in HLS fails but switching to it succeeds. On some devices HLS has video if you enter full screen before it starts to play, on others it only has video if you enter full screen after it starts to play. On some devices the full screen button disappears after you start to play.
It's not ideal and it's honestly very hacky, but I've come up with this ugly solution:
// 1.
video.addEventListener('click', requestFullScreen);
// 2.
function requestFullScreen() {
video.removeEventListener('click', requestFullScreen);
video.webkitRequestFullScreen();
}
// 3.
function reloadVideo() {
var ext = video.src.substr( video.src.lastIndexOf('.') ).toLowerCase();
if( ext == '.m3u8' ) {
video.load();
video.play();
}
}
// 4.
video.addEventListener('webkitbeginfullscreen', reloadVideo, false);
video.addEventListener('webkitendfullscreen', reloadVideo, false);
// 5.
video.addEventListener('webkitfullscreenchange', reloadVideo, false);
This is to fix the "full screen button disappears after you start playing on some devices" bug
We give this function a name so we can remove it later. If they request to exit fullscreen then they will not blame your player if the full screen button disappears. At this point they'll blame the phone and they'll refresh the page. This way people don't get pissed off if they accidentally fullscreen it again while trying to scroll
A helper function. We don't want to restart videos when going fullscreen unless we have to
The stock Internet browser throws these two events
Chrome throws this event
There are a number of other hacks I've had to implement, as well. For instance, the stock Internet browser on the Galaxy S4 does not always throw an ended event when reaching the end of a video. For this reason I have a setInterval checking every 1 second. If the video has moved less than 0.5 seconds in the last 1 seconds and it was never paused (I have a flag that's set in the resume and pause events) then assume you've hit the end.
I've had success using preload="none". Switching to auto will only play audio, using none will play both video and audio properly. This was tested on a Samsung S3, Android 4.4.2.
EDIT: autoplay also contributes to the problem. Removing it appears necessary.
I have a problem that I can only describe: I have an App which plays two different Videos in a VideoView when certain buttons are pressed. I am now testing the app on android 2.3. One of the videos is around 100 MB and the other one is around 6 MB. I believe that the issue happens when I'm playing the big file, but I'm not sure.
The issue is that at some point the image shown in the VideoView freezes. From this time on every VideoView (even of other Apps) shows the same frozen video frame. It stays like this until I reboot the phone.
Does anybody has an Idea whats wrong?