media-player

Do the latest Android updates disable the battery optimization whitelist?

醉酒当歌 提交于 2019-12-10 13:58:33
问题 TL;DR Did the 'June 5, 2017' security updates for Android 7.1.2 cause Android to start ignoring the battery optimization whitelist (i.e. the thing that's meant to let an app disable Doze mode)? And if so, how can an app now programmatically disable Doze mode if it has a use-case that requires the CPU and wifi be kept continuously active? Context I have an Android app which supports casting local audio files to a networked Chromecast receiver (using an embedded HTTP server to stream the file

Correct usage of Android's SeekBar?

前提是你 提交于 2019-12-10 12:15:33
问题 I tried plugging a SeekBar into my video app, but it doesn't seem to ever reach the end of the bar. Here's the code: videoSeekBar = (SeekBar) activity.findViewById(R.id.videoPlayerSeek); videoDuration = player.getDuration(); videoSeekBar.setMax(videoDuration); videoSeekBar.setProgress(0); // Start lengthy operation in a background thread new Thread(new Runnable() { public void run() { while (videoPlayProgress < videoDuration) { videoPlayProgress = player.getCurrentPosition(); // Update the

unable to play video in iOS 4

扶醉桌前 提交于 2019-12-10 11:25:55
问题 I have written code to play video in iPhone OS 3.1.3 and video is playing fine. but when i am trying to play video with the same code then video is not playing in iOS 4. I know that Media player framework is changed for iOS 4. Is there any way i can play the video on different OS without preparing separate binary?? 回答1: First check if you are on OS 3.2 or above. If yes, create a movie player the new way: if (NSClassFromString(@"UISplitViewController") != nil) { MPMoviePlayerViewController *mp

how to enable media sound even in silent mode

十年热恋 提交于 2019-12-10 10:01:09
问题 how do i start the sound even in silent mode? i got my audio file in my raw folder. i've made some codes but when i go to sound settings of android the ringtone and alarm are the only ones that are changed to maximum but not the media part. here is my code public void playSound(Context context) { AudioManager audioManager = (AudioManager)context.getSystemService(Context.AUDIO_SERVICE); int maxVolumeAlarm = audioManager.getStreamMaxVolume(AudioManager.STREAM_ALARM); int maxVolumeRing =

Can Android MediaPlayer play audio in a zipped file?

拈花ヽ惹草 提交于 2019-12-10 09:32:33
问题 CODE EDITED: I am developing a dictionary app for Android. I have been succeeding in making the app pronounce each word being looked up. Here is the code: btnPronounce.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // TODO Auto-generated method stub //Log.i(MAIN_TAG,"Start pronounciation ..."); btnPronounce.setEnabled(false); String currentWord = edWord.getText().toString().toLowerCase(); try { ZipFile zip = new ZipFile("/sdcard/app_folder/sound/zip

Android — Multiple, Simultaneous Streaming Audio

穿精又带淫゛_ 提交于 2019-12-10 03:54:08
问题 I currently have the need to implement an application on the Android device that can open up live audio streams and play them back to the user. This is not a big deal, and I have successfully set up a streaming server and got it working for one file. My question is, however, how do I stream and play multiple audio files at once? When I open up more than one stream (using MediaPlayer) and prepare and play each file, I only hear the audio from one file. I'm not sure this is currently possible,

Develop a custom media player on iPhone

ⅰ亾dé卋堺 提交于 2019-12-10 00:32:49
问题 I'm interested in developing a Custom Media Player on iPhone. Can you give me a basic idea to start with, i would like to know the libraries / API's which supports to develop my own player. My custom media player has to play from local hard disk, and as well as it has to stream over network. Can you please help me out to give a start in right direction? Thank You in advance. Suse. 回答1: You should use AVFoundation.Framework, MediaPlayer.Framework. Here are the sample code for, Music player

Android Lock Screen and Keyboard Controls

亡梦爱人 提交于 2019-12-09 23:37:31
问题 I am part way through writing a media player app for Android. It's all going really well so far, however I am now reaching the difficult stage! I have two questions. Do i need to implement a service activity? As I understand it, this is required to allow the app to continue working in the background. However, mine is working fine while I move to other programs on the tablet, and returns to the app without problems. Can someone please explain what the advantages are of services? Secondly, I

'JWPlayer-iOS-SDK/JWPlayerController.h' file not found

懵懂的女人 提交于 2019-12-09 19:22:37
问题 Followed the steps given at :https://developer.jwplayer.com/sdk/ios/docs/developer-guide/intro/getting-started/ to import JWPlayer For troubleshooting: https://developer.jwplayer.com/sdk/ios/docs/developer-guide/troubleshooting/troubleshooting/ Also installed cocoapods and in Podfile added: pod 'JWPlayer-SDK', '~> 2.4.3' ran pod install command later. What am I missing? 回答1: By cocoa pod installation you must use below path to import: #import <JWPlayer-SDK/JWPlayerController.h> And by adding

Media Player socket exception in Samsung Grand

微笑、不失礼 提交于 2019-12-09 19:00:55
问题 we are playing media through a local proxy server. Everything was fine till the new Samsung Grand device. In that specific device we are getting a Socket exception as following: 4-04 17:55:35.646: W/System.err(15187): java.net.SocketException: sendto failed: ECONNRESET (Connection reset by peer) 04-04 17:55:35.646: W/System.err(15187): at libcore.io.IoBridge.maybeThrowAfterSendto(IoBridge.java:506) 04-04 17:55:35.646: W/System.err(15187): at libcore.io.IoBridge.sendto(IoBridge.java:475) 04-04