media-player

How to stream audio/video files such as MP3, MP4, AVI, etc using a Servlet

女生的网名这么多〃 提交于 2019-12-17 03:17:16
问题 I would like to stream my audio/video files to web using servlet. I made an attempt with the following servlet: protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { File file = new File("/Users/myfolder/Documents/workspace/love.mp3"); response.setContentType(getServletContext().getMimeType(file.getName())); response.setContentLength((int) file.length()); Files.copy(file.toPath(), response.getOutputStream()); } And the following

Having 2 Mediaplayer objects playing in sync - Android

孤街醉人 提交于 2019-12-14 04:22:35
问题 In my android game I want to have a rhythm Mediaplayer object and a lead Mediaplayer object playing in sync. However at the moment the rhythm is a slight bit behind the playback of the lead Mediaplayer object. Is there a way I can make it so that both are started at the same time, for instance using Runnables etc?! It's quite crucial that they play in sync with each other as you can imagine! Many thanks 回答1: Try using SoundPool which seems to be created just for this kind of task. An example.

streaming audio player for background play

喜你入骨 提交于 2019-12-14 04:14:46
问题 Currently, I am developing an app in which there is need of play an streaming audio. I am using mpmovieplayercontroller to play streaming audio. It is working fine for me. However, the audio is stopping when the device goes into sleeping mode or enters into background mode. I want to play audio also in these two mode condition. How can I play streaming audio in these two modes? I am also open to another player. 回答1: I'd check out Matt Gallagher's Audio Streamer. I use it in an audio streaming

BlackBerry - “Media unloaded while initializing” error

我的未来我决定 提交于 2019-12-14 02:38:40
问题 I am trying to play a video based on the videorecordingdemo sample from JDE7.0 (code below). I am building for OS5.0 - which is why I cannot just run the whole demo app which is written for OS7.0. I am using the emulator (9300) and have set up a folder to be used as my sd card. I have placed a .AVI video in there. I have also tried placing the .AVI into the resources, and streaming it from there. In both cases, when I call Player.start() , the following exception is thrown: net.rim.device

Why Google play rejected my app they saying “for violating our dangerous products policy”

て烟熏妆下的殇ゞ 提交于 2019-12-13 19:22:21
问题 I uploaded my app on google play store but after few hours i got an email saying: This app uses software that contains security vulnerabilities for users. Below is the list of vulnerabilities and the corresponding APK versions that were detected in your recent submission. Please upgrade your app(s) as soon as possible and increment the version number of the upgraded APK. Vulnerability OpenSSL The vulnerabilities were fixed in OpenSSL versions beginning with 1.0.1h, 1.0.0m, and 0.9.8za. To

Do all versions of Android support the MediaPlayer streaming?

◇◆丶佛笑我妖孽 提交于 2019-12-13 19:10:40
问题 As the title says, I'm basically wondering if the MediaPlayer streaming support works for all versions of Android. Here is the code I'm currently using, which works fine on my Android 2.2 phone: MediaPlayer mp = new MediaPlayer(); mp.setDataSource(SHOUTCAST_STREAM); mp.prepare(); mp.start(); But will that work on say 1.5 or 1.6? Or would I have to build my own buffering management system for the stream? * Update * Just tested it on the 1.6 emulator, and getting the following errors. On the 2

MediaPlayer finalized without being released… Sound is getting stop

▼魔方 西西 提交于 2019-12-13 18:25:23
问题 My code is working properly but suddenly sound is getting stop with this error "MediaPlayer finalized without being released" My Code is public void PLAYSOUND(MediaPlayer Player, boolean value,SOUND sound) throws IllegalArgumentException, SecurityException, IllegalStateException, IOException{ try { AssetFileDescriptor descriptor = null; if (Player != null) { Player.stop(); Player.release(); Player = new MediaPlayer(); }else Player = new MediaPlayer(); descriptor = GameManager.getInstance()

Create player (which doesn't play file)

喜你入骨 提交于 2019-12-13 17:56:23
问题 I have a class that create video player (code is attached below), this class work only with video file. I want to show the player without a video file, and when I send to the object, by public method " setFile ", it's will start to play. I tried to send "null", instead of a file to this class, but I got an error (" java.lang.NullPointerException "). VideoPlayer player = new VideoPlayer(null, videoWidth, videoHeight); And the error: Exception in Application start method java.lang.reflect

Android RTSP - MediaPlayer init failure / PVMFFailure

不打扰是莪最后的温柔 提交于 2019-12-13 14:08:23
问题 I have a camera by Cisco and like to stream it's video stream to my android phone. It's coded in MPEG4 so there should be no problem, but it's not working anymore (it worked with another camera a few weeks ago). Any idea what I might try ? I don't know what's wrong here. I/ActivityManager( 79): Starting activity: Intent { cmp=com.Projekt1/.CameraView } I/System.out(18792): SDPURL - rtsp://10.42.0.103:554/live.sdp I/NotificationService( 79): enqueueToast pkg=com.Projekt1 callback=android.app

mediaplayer framework not playing video in iOS 6

↘锁芯ラ 提交于 2019-12-13 12:39:36
问题 I am using the mediaplayer framework included in iOS 6 to try and play a movie from within an app. I import and then: -(IBAction)playMovie:(id)sender { NSString *filepath = [[NSBundle mainBundle] pathForResource:@"buyTutorial" ofType:@"mov"]; NSURL *fileURL = [NSURL fileURLWithPath:filepath]; MPMoviePlayerController *moviePlayerController = [[MPMoviePlayerController alloc] initWithContentURL:fileURL]; [self.view addSubview:moviePlayerController.view]; moviePlayerController.fullscreen = YES;