media-player

Implementing playlists with songs from phone storage [windows phone]

帅比萌擦擦* 提交于 2019-12-29 09:03:41
问题 I have been struggling with an issue with my media player windows phone (7) application. The problem is that I can't seem to implement playlists. What I want to do is play songs from the media library. This article seems pointless. I've tried getting into the SongCollection class and figure out how to create more of these things. It appears to be impossible (no constructor, can't cast it, can't inherit it). After that I tried getting an object on the process running the background audio agent

Implementing playlists with songs from phone storage [windows phone]

走远了吗. 提交于 2019-12-29 09:03:40
问题 I have been struggling with an issue with my media player windows phone (7) application. The problem is that I can't seem to implement playlists. What I want to do is play songs from the media library. This article seems pointless. I've tried getting into the SongCollection class and figure out how to create more of these things. It appears to be impossible (no constructor, can't cast it, can't inherit it). After that I tried getting an object on the process running the background audio agent

Use DLL resources for WPF MediaPlayer

十年热恋 提交于 2019-12-29 08:21:30
问题 In my project I have a DLL for some WPF/XAML controls that need to play some audio files. Now, with SoundPlayer I can make these audio files "Embedded Resources" of the DLL (that also contains the WPF controls). However, SoundPlayer has some severe limitation so I switched to MediaPlayer. Unfortunately, the MediaPlayer help page states that MediaPlayer can't work with resources. (I tried using Pack URIs anyway but this didn't work - at least none of the combinations I've tried.) So, for now,

Use DLL resources for WPF MediaPlayer

老子叫甜甜 提交于 2019-12-29 08:21:27
问题 In my project I have a DLL for some WPF/XAML controls that need to play some audio files. Now, with SoundPlayer I can make these audio files "Embedded Resources" of the DLL (that also contains the WPF controls). However, SoundPlayer has some severe limitation so I switched to MediaPlayer. Unfortunately, the MediaPlayer help page states that MediaPlayer can't work with resources. (I tried using Pack URIs anyway but this didn't work - at least none of the combinations I've tried.) So, for now,

Create mediaplayer with inputstream in android

元气小坏坏 提交于 2019-12-29 07:06:22
问题 How to I create mediaplayer instance with inputstream? I see only 4 function for setDataSource. And there is no function getting inputstream ? is it a must to use FileDescriptor to mediaplayer ? It seems so basic. but, I couldnot find a way. In j2me, there is a function that Manager.createPlayer(InputStream) . And you can use inputstream to create a media player. Is there a way to create a mediaplayer like j2me ? 回答1: One approach can be to write your stream to a File and then give it to the

MediaController with MediaPlayer

给你一囗甜甜゛ 提交于 2019-12-29 02:48:30
问题 I want media controls such as play/pause for streaming audio that I am playing in my app. I am using MediaPlayer to stream and play the audio. Can someone provide a code snippet on how to use MediaController with MediaPlayer? Thanks Chris 回答1: It's quite simple to add media controller in a media player. Make your activity implement MediaPlayerControl and add unimplemented methods. Code is as below: I am using code from Api demos from here http://developer.android.com/resources/samples

Modifying FileInputStream for mediaPlayer setDataSource

拜拜、爱过 提交于 2019-12-29 01:44:09
问题 I'm trying to modify (extend) the FileInputStream class so that I can open an encrypted file and use the stream for MediaPlayer's setDataSource(FileDescriptor) . Problem is I don't know which method should be overridden to do the decryption inside the stream. I tried overriding all the read() methods, but the mediaPlayer doesn't seem to use them. Any suggestions? 回答1: I don't think that MediaPlayer accepts any kind of InputStream. You can't modify data read from file that are used in

How to play the audio files directly from res/raw folder?

柔情痞子 提交于 2019-12-28 03:56:46
问题 I have multiple audio files in res/raw folder. I showing ListView that contains audio files name. I want to play the corresponding audio file when user select into the ListView . I have used setDataSource(path) , but it showing error while playing. How play the audio files directly from that folder? Or Is there any other way? 回答1: add this code in onItemClickListener. listView.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> arg0, View view,

How to play a video file from SD card

余生长醉 提交于 2019-12-26 15:30:48
问题 I want to play a video file on android emulator that I have stored in sd card. This is my code.. public class AndroidVideoViewActivity extends Activity { private VideoView videoView=null; private String PATH="mnt/sdcard/bmxskills.3gp"; private MediaPlayer mediaPlayer=null; private MediaController mediaController=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); VideoView videoView=(VideoView)findViewById(R.id

How to play a video file from SD card

隐身守侯 提交于 2019-12-26 15:22:11
问题 I want to play a video file on android emulator that I have stored in sd card. This is my code.. public class AndroidVideoViewActivity extends Activity { private VideoView videoView=null; private String PATH="mnt/sdcard/bmxskills.3gp"; private MediaPlayer mediaPlayer=null; private MediaController mediaController=null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); VideoView videoView=(VideoView)findViewById(R.id