media-player

Can you play a List<Song> continuously in the background on Windows Phone 8

夙愿已清 提交于 2019-12-12 04:09:47
问题 I have a list of songs (List<Song>) and i want to play all the songs even if the application goes into the background or under the lock screen. I cannot use a SongCollection and MediaPlayer.Play(SongCollection) because i cannot create a SongCollection object from a List<Song> . Is there anyway i can play this list of songs in the background, one by one (MediaPlayer.Play()) or otherwise? 回答1: The answer is right in the documentation for SongCollection class: http://msdn.microsoft.com/en-us

Mediaplayer error (-19 0) doesn't work with release()

こ雲淡風輕ζ 提交于 2019-12-12 03:55:47
问题 I'm coding a Soundboard and I got a problem when you have clicked 20+ times on the sounds. First I get MediaPlayer error(-19 0) and you can't hear any more sounds. I know it's my memory. So when I try to add Release(); it doesn't sound at all. Here is a button that plays sound: public void click7(View v) { MediaPlayer mp = MediaPlayer.create(NewActivity3.this, R.raw.hahah); mp.start(); } I have been trying with release as well then there's no sound: public void click7(View v) { MediaPlayer mp

Instantiating a web view media player within a JavaFX application

倖福魔咒の 提交于 2019-12-12 03:26:28
问题 I am writing a piece of educational software, and want the user to be able to select a video to watch from a list that lies within my JavaFX GUI. I have created a mediaPlayer class that contains a main method that runs the code and displays the video correctly, however my next task is to instantiate the mediaPlayer class, and pass the URL of the video to be watched as a parameter. I have attempted to code a MediaPlayerTest , whereby I instantiate the mediaPlayer , pass it a URL as a parameter

How to use SMIL file in Android development

江枫思渺然 提交于 2019-12-12 02:54:07
问题 My requirment is to make Media player based on SMIL language on android platform is it possible to use SMIL file in android? Thanks Advace 回答1: Not 'out of the box' (although you didn't tell us exactly which android box you might be in). But there are several other questioners asking this very question, leading me to believe this belongs in the "do my homework for me" category. And a quick search would have revealed this answer: Parse application/smil MMS MIME type on android ...where the

iOS Mediaplayer and URL redirection

萝らか妹 提交于 2019-12-12 02:34:40
问题 I'm trying to implement a MPMedia player to play internet files. So far I have managed to open the media player with links to videos hosted by me. The problem starts when I try to load an url that doesn't directly map to a file but instead gets redirected to the file. The initial url looks like this: h*tp://www.example.com/ numbers/numbers/numbers and when I put it in my browser it is automatically changed for something like this: h*tp://www.example.com/ numbers .mp4?to= numbers When I use

Android: How to stop media player onclick of a button

戏子无情 提交于 2019-12-12 02:07:36
问题 I have a play and stop button. When I run the following codes, Play button goes well. But when I click the stop button, I'm getting a force close message. I'm new to android dev. Many thanks in advance! :) 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.view.View; import android.widget.TextView; public class HelloMedia extends Activity { /** Called

Media Player streaming, when Exit app music should stop

狂风中的少年 提交于 2019-12-12 01:53:53
问题 I currently have a mediaplayer streaming some mp3 files. What I would like to do is if the User presses the home button to exit the app, the music stops playing. how would I go about doing this? 回答1: In your app' onPause() or onDestroy() call mediaPlayer.stop() . 回答2: @Override public boolean onKeyDown(int keyCode, KeyEvent event) { if ((keyCode == KeyEvent.KEYCODE_HOME)) { Log.d(this.getClass().getName(), "home button pressed"); } return super.onKeyDown(keyCode, event); } Something like this

PowerShell Script to play video with Windows Media Player

五迷三道 提交于 2019-12-12 01:42:23
问题 I have a requirement to run a video via windows Media Player. And also track the duration it play. Suppose I close the video in 5 Sec it should give the duration 5. The below is the script I wrote. But there is problem with this. As the video do not launch nor I am able to the application getting launched . I am only able to here the audio. Add-Type -AssemblyName presentationCore $filepath = [uri] "C:\Temp\test\Wildlife.wmv" $wmplayer = New-Object System.Windows.Media.MediaPlayer $wmplayer

Prevent Mp3 file to play in another Media player

倾然丶 夕夏残阳落幕 提交于 2019-12-12 01:34:03
问题 I am developing media player and my application download mp3 file from server . So i want to prevent it from another media player to play it. Case User get file from server (music file1.mp3) in android phone ! User play it in our player but can't share it or download it in computer or play in another media player. I try Below I can encrypt a file and decrypt it again in my app (will take long time, it's a mobile cpu!), but then my application needs to have the decryption key inside. Basically

audio streaming in Android with the MediPlayer class

99封情书 提交于 2019-12-12 00:30:03
问题 I'm testing the audio streaming in Android with the MediPlayer class. I want to develop an application to play web radios. The streaming over http works. The code below work fine on emulator with Froyo(v. 2.2) but didn't work with Eclair (v. 2.1) // in onStartCommand String url = "http://........"; // your URL here MediaPlayer mediaPlayer = new MediaPlayer(); mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC); mediaPlayer.setDataSource(url); mediaPlayer.prepareAsync(); // might take