media-player

How to use a MediaPlayer Singleton

帅比萌擦擦* 提交于 2020-01-03 02:57:13
问题 I am new to Android developing and am starting with a simple soundboard application. I started developing a soundboard using multiple fragments until I realized that I was using multiple instances of MediaPlayer. This is not good because I want only one sound to play at a time. I realized that I'd have to use a MediaPlayer Singleton to solve my problem. The only problem is that I can't find many sources or examples of the MediaPlayer Singleton online. Here's what I originally put into every

Android: How to display text in certain milliseconds while media (mp3) is playing

回眸只為那壹抹淺笑 提交于 2020-01-02 07:20:35
问题 I'm trying to do a karaoke-like application . I want to display a word or words when a certain milliseconds come. For example: 1148 ms -> print "Nicholas " 1826 ms -> print "was " 2766 ms -> print "older " ... *** ms -> display "*** " Here's my code: package com.example.hellomedia; import java.io.IOException; import android.app.Activity; import android.media.MediaPlayer; import android.os.Bundle; import android.os.Handler; import android.widget.TextView; public class HelloMedia extends

Failure code -32 MediaPlayer (Android 4.4)

巧了我就是萌 提交于 2020-01-02 07:13:25
问题 Hello guys my app returns failure code -32 when trying to play a video in Android 4.4 (KitKat). I can't actually find any information about this errorcode perhaps any of you knows more about this issue? 11-04 13:43:08.966: E/AndroidRuntime(26482): java.lang.RuntimeException: failure code: -32 11-04 13:43:08.966: E/AndroidRuntime(26482): at android.media.MediaPlayer.invoke(MediaPlayer.java:664) 11-04 13:43:08.966: E/AndroidRuntime(26482): at android.media.MediaPlayer.getInbandTrackInfo

Is MPNowPlayingInfoCenter compatible with AVAudioPlayer?

安稳与你 提交于 2020-01-02 02:48:09
问题 I start -play with AVAudioPlayer , and then set the nowPlaying dictionary like this: NSMutableDictionary *songInfo = [[NSMutableDictionary alloc] init]; MPMediaItemArtwork *albumArt = [[MPMediaItemArtwork alloc] initWithImage: [UIImage imagedNamed:@"AlbumArt"]]; [songInfo setObject:@"Audio Title" forKey:MPMediaItemPropertyTitle]; [songInfo setObject:@"Audio Author" forKey:MPMediaItemPropertyArtist]; [songInfo setObject:@"Audio Album" forKey:MPMediaItemPropertyAlbumTitle]; [songInfo setObject

Seeking in AAC streams on Android

旧巷老猫 提交于 2020-01-01 17:09:10
问题 I'm getting an AAC stream from a HTTP server and using that as the datasource for the MediaPlayer in Android. It plays perfectly fine, but when I try to execute mediaPlayer.seekTo(int position) I get the following errors about a million times: WARN/AACDecoder(13889): AAC decoder returned error -1, substituting silence WARN/AACDecoder(13889): AAC decoder returned error 10, substituting silence WARN/AACDecoder(13889): AAC decoder returned error 1, substituting silence This error happens on

UDP Video Streaming on Android

末鹿安然 提交于 2020-01-01 10:02:08
问题 I have an Android project where I need to build a client app to receive UDP or RTP unicast video streams and play them back. Unfortunately, I cannot seem to get this working and have searched extensively for a solution! I have being testing on a Xoom (Android 3.2) and a Nexus S (Android 2.3.6) and know that they can play the content when using MX Player (a third-party media player app) as the client but I can't get the native media player to play back the content. I have tried using both a

how to get bit rate , sampling rate and no. of channels of a audio file in android

和自甴很熟 提交于 2020-01-01 09:33:15
问题 I need your help for the below query: Query: Is there any way of getting following info of an audio file. Sample rate, Channel, Bitrate of an audio file. For extracting bitrate, "MediaMetadataRetriever" API is available (METADATA_KEY_BITRATE). Please suggest if it can be done using any android API. Found this below API, But its use is actually in different. http://developer.android.com/reference/android/medi/AudioTrack.html I want to extract these using Android API programmactically :

What algorithm/approach to use to synchronize multiple video players

感情迁移 提交于 2020-01-01 09:17:13
问题 Motivation: I am currently trying to synchronize two videos on two networked raspis. I tried live streaming from a desktop (http and udp) but each raspi still opened the stream with a noticeable delay. I next tried installing vlc on the raspi and synchronizing with the desktop vlc, but that did not work either. I tried using a shell script to launch omxplayer at near the same time on both raspis, and that failed too. Finally I used a C script to launch the two omxplayers at near identical

android ANR in MediaPlayer reset

馋奶兔 提交于 2020-01-01 07:33:11
问题 I've got a simple activity which plays video through VideoView public class AVideo extends Activity { private VideoView mVideoView; private MediaController mc; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.a_video); Bundle extras = getIntent().getExtras(); Uri path = Uri.parse(extras.getString("videoURI")); mVideoView = (VideoView) findViewById(R.id.video); mVideoView.setVideoURI(path); mc = new MediaController(this);

How play the video using “HTTP Live Streaming” in iphone?

旧时模样 提交于 2020-01-01 05:20:08
问题 I am new to iphone development,I am parsing a XML URL and display its content in the table, when i click a row , its corresponding parsed tube URL is played using the movie player.I am using media player framework.Here is my code NSURL *movieURL = [NSURL URLWithString:requiredTubeUrl]; if (movieURL) { if ([movieURL scheme]) { MoviePlayerController *myMovie = [[MoviePlayerController alloc]init]; [myMovie initAndPlayMovie:movieURL]; } } This is working fine, but i want to play the video using