media-player

Set maximum recording duration,while video recording from iphone app

烂漫一生 提交于 2019-12-07 13:31:04
问题 In my iPhone app,a user can record the video.I want to set the maximum allowed time of recording is to 30seconds.How to do that,any ideas ? using this code -(BOOL)startCameraControllerFromViewController:(UIViewController*)controller usingDelegate:(id )delegate { if (([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera] == NO) || (delegate == nil) || (controller == nil)) { return NO; } UIImagePickerController *cameraUI = [[UIImagePickerController alloc] init]

Android: What video format/encoding should I use to support most of the android devices

蓝咒 提交于 2019-12-07 13:25:14
问题 I have a collection of video clips which user should be able play from inside my app (not external video player). I am using VideoView with MediaController. Everything works as expected on my Desire HD and Nexus S (both running Android 2.3.3). However they won't play on order devices. I get "Sorry, this video cannot be played" error message. All videos are mp4, encoded with H.264, 720w/480h, 25fps . I have also used H.263(3gp) but with no luck. I want to support as many Android devices as

How to know the Duration of audio song before streaming?

假装没事ソ 提交于 2019-12-07 06:36:33
问题 I am making an application for Stream audio song. In Custom media player, i have to show the total duration of that audio file. If a audio song will be SDCard , i can know its duration using MediaPlayer player; public double duration() { return player.getDuration(); } But in my case audio file is on the server, so i have to stream it. What is the best approach? 回答1: This might help you: Example of Streaming mp3 with android media player class . The respective data is probably available, once

How to make lock screen notification for media player

孤街浪徒 提交于 2019-12-07 05:09:39
问题 I am trying to get lock screen in the mobile I am able to get every thing work like notification and other things of my app but when I try to display the lock screen it is not working at all for android M. private void initMediaSession() throws RemoteException { if (mediaSessionManager != null) return; //mediaSessionManager exists ComponentName mediaButtonReceiver = new ComponentName(getApplicationContext(), MediaButtonReceiver.class); mediaSession = new MediaSessionCompat

C# Com Interop with Windows Media Player Visualisation (With Sample Code)

非 Y 不嫁゛ 提交于 2019-12-07 04:41:01
问题 I am attempting to create a Windows Media Player (WMP) Visualization plugin in C#. I am quite new to exposing C# to COM and may have missed something basic. I have persisted with this for 3 days (about 20 hours) and not got past the single issue I will describe below. For those who don't know, WMP visualizations are the pretty images that show in media player while listening to music. In a nutshell : WMP will call certain methods on my C# COM interface, but not others. I have WMP 11 installed

Android: MediaPlayer video aspect ratio issue

ぃ、小莉子 提交于 2019-12-07 03:46:31
问题 I am having an issue that I am unable to resolve. I am using MediaPlayer class to play video; however, I am always loosing the original aspect ratio. The media player code and the xml code is mentioned here. I have tried so many things but still not able to resolve the issue. I need to maintain the original aspect ratio. I have declared this activity to be full screen in my Android Manifest File. I have also attached the xml code here after the media player code. Please advise me. private

Check if onStop is called from user interaction, or screen dimming

柔情痞子 提交于 2019-12-07 03:46:28
问题 I have a media player that stops playing whenever the user closes the app, either by pressing the home button, using the back button or simply opening another app. To get this behavior, I added an onStop() to my main activity which tells my MediaPlayer (which is in a service) to stop playing music. However, I would like the music to keep playing whenever the screen gets dimmed, either by using the power button to turn the screen off, or just by the screen auto dimming. Right now the player

MediaPlayerLauncher on WP7 - how to resume previously playing media?

梦想与她 提交于 2019-12-07 01:52:23
问题 I'm using a MediaPlayerLauncher to show movietrailers in my WP7 application, like this: MediaPlayerLauncher mpl = new MediaPlayerLauncher(); mpl.Media = new Uri(trailerUrl, UriKind.Absolute); mpl.Controls = MediaPlaybackControls.All; mpl.Show(); This works just fine, except one thing: if the user is already listening to music in the background, and launch a trailer, the music is not resumed after the trailer is done playing (or if the user closes the video). Does anyone know how i can resume

MediaPlayer stops and restarts

随声附和 提交于 2019-12-07 01:23:04
问题 I get a weird error. I play with a MediaPlayer a mediastream (like shoutcast or icecast). Sometimes suddenly on playing stream (total random) happens a error, the stream stops and restart. OnErrorListener don't get triggered! Logcat: 03-02 17:50:36.274: W/MediaPlayer(16799): info/warning (702, 0) 03-02 17:50:36.274: I/MediaPlayer(16799): Info (702,0) or like this: 03-02 17:50:14.250: W/MediaPlayer(16799): info/warning (703, 0) 03-02 17:50:14.250: W/MediaPlayer(16799): info/warning (701, 0) 03

Audio seekBar Thread Problem?

◇◆丶佛笑我妖孽 提交于 2019-12-07 00:57:27
Originally, I had a MediaPlayer mPlayers to play/pause/stop my Audio file. Now, I'm trying to add a seek bar for my media. I tried using Threads and this is what I came up with: In onCreate() : seekBar.setOnSeekBarChangeListener(new SeekBar.OnSeekBarChangeListener() { @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { // TODO Auto-generated method stub mPlayer.seekTo(progress); } ////........Omitted Code..........\\\\ //At the very end of the method: seekThread = new Thread(this); //My Activity implements:Runnable seekThread.start(); Then, I implemented