media-player

What algorithm/approach to use to synchronize multiple video players

蹲街弑〆低调 提交于 2019-12-04 04:06:39
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 times, which also failed. Ultimately, I don't think it is possible to control when omxplayer starts

Android Mp3 play from url

▼魔方 西西 提交于 2019-12-04 04:02:06
How do I run the following tutorial using an online mp3 url? I tried replacing the url but it doesn't seem to be working. I want to use the same code but with the url. Does anyone have any suggestions? The tutorial linke: http://www.tutorialspoint.com/android/android_mediaplayer.htm The mp3 url is: http://searchgurbani.com/audio/sggs/1.mp3 Jorgesys How to play an .mp3 from the /raw folder: Download the .mp3 file, save it to song.mp3 and paste into the /raw folder. If you don´t have /raw folder, just create it into the /res folder. this example doesn´t load the .mp3 from internet, play the .mp3

Android 4.0.4 MediaPlayer prepare issue using RTSP urls

倾然丶 夕夏残阳落幕 提交于 2019-12-04 03:45:02
I am experiencing an odd issue with a video streaming application I am working on. The actual streaming of video/audio is working fine on all of my test devices. However, on seemingly any device 4.0+, when using an RTSP URL, prepare() returns instantly (this causes an issue providing proper feedback to the users while a video is loading and interferes with a few other systems I have in place). Below is the block of code where I initialize and setup my MediaPlayer, but keep a few things in mind: My initPlayer method is called from an AsyncTask. The video does eventually play correctly, but

Android Media Player Restart Audio After Calling Stop

陌路散爱 提交于 2019-12-04 02:53:55
问题 I'm able to stream audio and stop it without any problem, but when I try to start it again after stop, it doesn't start and I get an IllegalState exception. Here is what I'm doing: Start Playing mediaPlayer.setDataSource(PATH); mediaPlayer.prepare(); mediaPlayer.start(); Stop Playing mediaPlayer.stop Now, if I want to start playing again the same media, what will I have to do? *PATH is the URL of a continuous running radio station. 回答1: Add this: mp.reset(); mp.setDataSource(MEDIA_PATH); mp

How to support MOV(quick time) in android?

老子叫甜甜 提交于 2019-12-04 02:46:54
问题 I want to play in .mov file in android. But videoview or mediaplayer doesn't support this meida format. How can i add the support to it? 回答1: In general Android doesn't support any other media formats than the one listed here. That being said, there are quite a few 3rd party players that enable playback of more exotic formats, most of which are probably based around ffmpeg. You might want to take a look at the open source Dolpin Player (actual player also available in the Play store) for

Android 4.2 with 4 MediaPlayers = “Can't play this video”

我与影子孤独终老i 提交于 2019-12-04 01:07:39
问题 Whenever I'm trying to load at least 4 mediaPlayers, one of them will corrupt the video it's trying to load and trigger an Android OS message "Can't play this video" Other information: For 3 mediaPlayers everything works fine. On other Android versions, different from 4.2, the same code with the same 4 video works. The 4 video can be played independently on the device. There is no format problem. After starting the program and getting the "Can't play this video" message, the video can no

android ANR in MediaPlayer reset

你。 提交于 2019-12-03 22:28:54
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); mVideoView.setMediaController(mc); } @Override protected void onResume() { super.onResume(); mVideoView

How to set proxy on MediaPlayer

£可爱£侵袭症+ 提交于 2019-12-03 21:01:24
In my music stream program, how can I set proxy on android.media.MediaPlayer class for stream a link file through the proxy network ? I know about NTCreditional, UsernamePasswordCreditional, Proxy-Authorization Header and etc in HttpClient , URLConnection . But I can not set proxy on android.media.MediaPlayer , how can I do it? Thanks for your advance :) yorkw Unfortunately MediaPlayer API doesn't provide a ready-to-use method for proxy setting at the moment. how can I do it? There is a possible workaround but quite dirty: Download the media contents from the remoteUrl http://remotehost:80

AVPlayer Dynamic Volume control

*爱你&永不变心* 提交于 2019-12-03 20:53:25
How can I change the volume of the AVPlayer Dynamically? I mean, I want to mute the volume every time a button is pressed. the given code seems to change it in compile time only. How to do it during runtime??? AVURLAsset *asset = [AVURLAsset URLAssetWithURL:[self myAssetURL] options:nil]; NSArray *audioTracks = [asset tracksWithMediaType:AVMediaTypeAudio]; NSMutableArray *allAudioParams = [NSMutableArray array]; for (AVAssetTrack *track in audioTracks) { AVMutableAudioMixInputParameters *audioInputParams =[AVMutableAudioMixInputParameters audioMixInputParameters]; [audioInputParams setVolume:0

Iphone - Writing a media player with lyrics

为君一笑 提交于 2019-12-03 17:29:52
I want to write a simple media player which displays lyrics that are retrieved from the web. I know once LyricWiki was such a source, but now no longer exists. Does a new API or source for lyrics exist that I can use ? When I do get the lyrics, how do I sync them with song ? I know the MPMediaItem class has the MPMediaItemPropertyLyrics but this is cleary not enough for me cause this is only for songs from Itunes and not all of them have lyrics available. I would appreciate any help or links that can I use to sort this issue. A little Googling and I found a few options that might solve your