android-mediaplayer

Can an Android (Java not C/C++) plugin alter unity textures?

人走茶凉 提交于 2019-12-22 15:04:19
问题 I'm trying to use an Android plugin to get around the fact that Unity does not support Video Textures on mobile. I do this by getting the texture ID of the texture that will be used for video (supplied by Texture2D.GetNativeTextureID() ) which i then pass into the Java Plugin. The plugin then follows a standard MediaPlayer implementation to play the video into a Surface Texture, which has been assigned the aforementioned texture ID. When i call the MediaPlayer.Start() method, LogCat outputs

java.lang.IllegalStateException: Not allowed to start service Intent while trying to run RingtoneService

五迷三道 提交于 2019-12-22 14:02:03
问题 I am creating an organizer app which contains many functions one of them is an alarm, while trying to start the RingtoneService for my alarm most of the times I get this exception "java.lang.IllegalStateException: Not allowed to start service Intent" because it's running in the background (sometimes it runs with delay)! I extensively searched for an answer and tried the following and none worked: - JobScheduler : I get the same exception - bindService() and writing the code inside

WARN/AudioFlinger(33): write blocked for 76 msecs, 7773 delayed writes, thread 0xb3f0

谁说我不能喝 提交于 2019-12-22 11:35:29
问题 I have created an intent service to start the music for my app in the background. It is working, but my log-cat is flooded with the messages: 09-14 16:46:30.117: WARN/AudioFlinger(33): write blocked for 76 msecs, 7773 delayed writes, thread 0xb3f0 and nothing else is getting Logged. Here is my IntentService: import android.app.IntentService; import android.content.Intent; import android.media.MediaPlayer; import android.media.MediaPlayer.OnErrorListener; import android.widget.Toast; public

MediaCodec encoder using Surface crashes inconsistently on various devices

你。 提交于 2019-12-22 11:25:27
问题 I'm developing an app that post processes video by applying graphics and text to the video. My code is based on the Android CTS test DecodeEditEncodeTest and it works great on the Nexus 4 and Nexus 5 (4.4) but not on any other device I've tried; not even the Nexus 7 II on 4.4. For example, on a Galaxy S3, I get the following errors: E/ACodec(17651): configureCodec multi window instance fail appPid : 17651 E/ACodec(17651): [OMX.qcom.video.decoder.avc] configureCodec returning error -38 E

MediaPlayer, Doze Mode, Wake Lock & Foreground Service

有些话、适合烂在心里 提交于 2019-12-22 10:46:43
问题 I have read several posts regarding the new 'Doze' Mode in Android M, also the article on Android developers website : https://developer.android.com/training/monitoring-device-state/doze-standby.html yet I still have an issue with a Foreground Service correctly running on a phone (Android 6.0.1). Issue: I have a Service which handles playing music using a MediaPlayer object, the Service Implements onCompletion and onPrepared MediaPlayer interfaces. Pseudo code: public class MusicService

MediaPlayer sometimes not preparing when screen is locked

爷,独闯天下 提交于 2019-12-22 10:23:37
问题 I have a MusicService for MediaPlayback, wich uses a MediaPlayer with the settings: player.setWakeMode(getApplicationContext(), PowerManager.PARTIAL_WAKE_LOCK); player.setAudioStreamType(AudioManager.STREAM_MUSIC); and those Listeners are set: OnPreparedListener, OnCompletionListener, OnErrorListener, OnSeekCompleteListener The MediaPlayer is used for mp3-Playback. When one Song is finished, onCompletion is called. Then PlayNext is called, wich resets the MediaPlayer, then sets the Datasource

Android Lollipop prepareAsync() takes a long time to return

ぐ巨炮叔叔 提交于 2019-12-22 09:59:16
问题 On Android Lollipop on Samsung Galaxy Note 4 (just updated a few weeks ago from 4.4.4) prepareAsync() takes almost exactly 20seconds to load live stream. On 4.4.4 it would only take 2-3 seconds and no error (see below). This seems to be a problem only for live streams. Pre recorded mp3's are ok. Here is a test: String url = "http://vprclassical.streamguys.net:80/vprclassical128.mp3" MediaPlayer mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);

MediaController not swiping in ViewPager

落爺英雄遲暮 提交于 2019-12-22 09:36:42
问题 I'm using a ViewPager to show several Fragments provided by a FragmentPagerAdapter . One of these Fragments shows a VideoView and an according MediaController . The issue I'm facing is, that the MediaController is not swiping to the left/right as it's supposed to together with the rest of the Fragment . (Hopefully you can follow me ^^) I've looked through a lot of similar discussions on StackOverflow, but unfortunatly none of them fixes my issue. This is my xml for the Fragment that is

How to play mp3+g on mediaplayer android

江枫思渺然 提交于 2019-12-22 07:00:18
问题 I know we can play mp3 file in MediaPlayer. But can we play mp3+g on android?? I saw in the documentation on android, but i didn't see it. http://developer.android.com/guide/appendix/media-formats.html Is there any work around or library to do this? Thanks 回答1: I don't "think" that Android is going to support mp3+g playback anytime soon. That being said an mp3+g "file" should either be one zipped file(with two files inside) or two separate files named the same with exception of the file

how to play sound Over background music

时光毁灭记忆、已成空白 提交于 2019-12-22 01:01:15
问题 I have an application that has single activity and I know How to play a background music using the Media player. As I have only one activity so I think I really do not need to play this music in the service. so I have little confusion so this is what I want. What I want : In my app I have a single activity and some buttons in it. I want to play sounds of different length on button click. But Mean while I really do not want to stop the back ground music it should play in background on the same