media-player

How to play video stream with MPMoviePlayerController in iOS

╄→гoц情女王★ 提交于 2019-11-27 11:50:46
I am trying to play a video stream from the internet on the iPhone by pressing a button. I used many code samples but nothing worked. With this code it opens a black view without any video stream or controls in it. (The stream itself works.) NSURL *url = [NSURL URLWithString:@"http://MyStreamURL.com"]; MPMoviePlayerController *moviePlayer = [[MPMoviePlayerController alloc] initWithContentURL:url]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(moviePlayBackDidFinish:) name:MPMoviePlayerPlaybackDidFinishNotification object:moviePlayer]; moviePlayer.controlStyle =

Android: How to create video player?

柔情痞子 提交于 2019-11-27 11:23:31
问题 I am creating a video recorder and would like to create video player to preview the recorded videos. Modifying the code from this page I have created a MediaPreview class the following way: public class MediaPreview extends Activity implements OnErrorListener, OnBufferingUpdateListener, OnCompletionListener, OnPreparedListener, SurfaceHolder.Callback{ private static final String TAG = "MediaPreview"; private MediaPlayer mp; private SurfaceView mPreview; private SurfaceHolder holder; private

Dealing with video (DVDs, .avi .mkv) in Java

我只是一个虾纸丫 提交于 2019-11-27 11:14:53
After looking around for a decent library for playing videos in Java, I've come unstuck. Everyone around is screaming not to use JMF because it's outdated, old and requires the user to install it, other alternatives such as VLCJ seem good if they work but are still relatively unstable and rely on hefty amounts of native code, and as for dealing with DVDs, that seems like gold dust to find in a free library! Current Options: Now JavaFX 2 is gaining momentum it's been something I've been seriously looking at (hence my question here ) but I've no luck so far in trying to work out how to make it

AVPlayer HLS live stream level meter (Display FFT Data)

时光毁灭记忆、已成空白 提交于 2019-11-27 09:56:30
问题 I'm using AVPlayer for a radio app using HTTP live streaming. Now I want to implement a level meter for that audio stream. The very best would a level meter showing the different frequencies, but a simple left / right solution would be a great starting point. I found several examples using AVAudioPlayer . But I cannot find a solution for getting the required informations off AVPlayer . Can someone think of a solution for my problem? EDIT I want to create something like this (but nicer) EDIT

java.lang.IllegalStateException what does it mean?

巧了我就是萌 提交于 2019-11-27 09:46:56
问题 I'm developing a video application. After 1st video playback done, in the "OnCopletion" I'm trying to start a new one. But it just stops (not crashes) and do nothing. In the log: 10-19 09:44:49.056: ERROR/MediaPlayer(4654): setDataSource called in state 128 10-19 09:44:49.056: WARN/System.err(4654): java.lang.IllegalStateException 10-19 09:44:49.056: WARN/System.err(4654): at android.media.MediaPlayer.setDataSource(Native Method) 10-19 09:44:49.056: WARN/System.err(4654): at ru.osiris

Unity load medias from folder and display on RawImage

断了今生、忘了曾经 提交于 2019-11-27 09:37:15
I am trying to create a media player in Unity that reads all media files from a static folder and plays trough all medias (images static duration, videos for the length of the video). First I am trying to get it to work with just images. I'm very new with Unity and not good with C#. I'm able to get all media file sources (images) to an array but next I need to convert them to a texture and place on the RawImage -component. I'm stuck with this part. If I have the src (ex. C:\medias\img1.jpg) then how could I place this as a image on the RawImage -component? My code -> using System.Collections;

MediaButtonIntentReceiver not working in Android 4.0+

折月煮酒 提交于 2019-11-27 09:15:51
The goal is to intercept broadcasts from the headset, as well as bluetooth eventually, to respond to different types of clicks from the headset to alter the mediaplayer. This solution works fine for all versions prior to ICS. Here is some of the code and things I have tried: .... private BroadcastReceiver mediaButtonReceiver = new MediaButtonIntentReceiver(); .... public void onCreate() { ... IntentFilter mediaFilter = new IntentFilter(Intent.ACTION_MEDIA_BUTTON); mediaFilter.setPriority(2147483647); // this is bad...I know this.registerReceiver(mediaButtonReceiver, mediaFilter); ... } public

Application threads vs Service threads

喜夏-厌秋 提交于 2019-11-27 08:01:16
What are the advantages/disadvantages in placing a lengthy network access code in a thread in an activity or a thread in a service? How would it affect the application? I am writing a streaming audio player and from what I've read so far putting the code in a service will still end up blocking the application so a new thread is needed, does anyone know if it makes more sense to put this piece of code in a service. Yes, a blocking operation in a Service will still block the application. Despite first appearances, Services are not simply for running tasks in the background. They are for running

NullPointerException while using Android's mediaplayer

。_饼干妹妹 提交于 2019-11-27 07:31:55
问题 I have two button and it will play a sound to notify about right choice, or wrong one. This is how I do it: MediaPlayer playError = MediaPlayer.create(QuizActivity.this, R.raw.error); playError.start(); Same with correct sound. It works fine most of the time, but when I click it many times, at random times I get this error: Basically it says line playError.start(); gives me NullPointerException (only sometimes) 07-21 23:05:32.767: ERROR/PlayerDriver(1287): Command PLAYER_PREPARE completed

How to control volume in android?

余生颓废 提交于 2019-11-27 07:07:39
问题 Android has the Hardware button for controlling volume (increase/decrease). I want to same functionality by using buttons in my application with visual volume control and it should be disappeared after some time (in sec). 回答1: You need to use the AudioManager class. Developer doc is here. Depending on which volume you want to adjust (ringer/media) you may need to change the audiomode via AudioManager . Finally, to make the buttons disappear just use View.GONE on them. I would create a