media-player

Android VideoView Error 1,0

给你一囗甜甜゛ 提交于 2019-12-13 12:15:53
问题 I have an application thats main goal is to play a specific video file. it plays the video correctly sometimes. But other times it gives me this error: 03-21 14:52:36.181: I/AwesomePlayer(119): setDataSource_l('/data/data/my.package.name/files/MyMovie.mp4') 03-21 14:52:36.196: W/VideoView(26612): Unable to open content: /data/data/my.package.name/files/MyMovie.mp4 03-21 14:52:36.196: W/VideoView(26612): java.lang.IllegalArgumentException: The surface has been released 03-21 14:52:36.196: W

Android 4.0.4 MediaPlayer prepare issue using RTSP urls

做~自己de王妃 提交于 2019-12-13 12:04:27
问题 I am experiencing an odd issue with a video streaming application I am working on. The actual streaming of video/audio is working fine on all of my test devices. However, on seemingly any device 4.0+, when using an RTSP URL, prepare() returns instantly (this causes an issue providing proper feedback to the users while a video is loading and interferes with a few other systems I have in place). Below is the block of code where I initialize and setup my MediaPlayer, but keep a few things in

Android How to get a single song's ID info from a know URI

ぐ巨炮叔叔 提交于 2019-12-13 11:43:47
问题 I know the URI of a single song. How do I get the song's info, title track, ect. Sorry all posts I can find provide a method to index the entire library, not how to get a single know URI song's info. This is what I am using to get the URI. audioID is being stored in a SharedPrefs. Thanks int REQUEST_MEDIA = 0; String audioID; Intent i = new Intent(Intent.ACTION_PICK, MediaStore.Audio.Media.EXTERNAL_CONTENT_URI); startActivityForResult(i, REQUEST_MEDIA);//REQUEST_MEDIA is some const int to

How to customize hello message for media app in android auto?

丶灬走出姿态 提交于 2019-12-13 10:00:48
问题 I'm currently developing one Android auto media app. How can I do the same as Spotify when users not login, to give a message "Please login to use spotify". I'm not gonna do a login judgement, I just want to change the default hello message shown on the dashboard. By default, the media app always show "To play something, open the menu...." How can I change it? Help! 回答1: You can use the setErrorMessage() in the PlaybackStateCompat class to accomplish this. When the PlaybackStateCompat is

Android MediaPlayer : How do i show a progress dialog while buffering audio

风流意气都作罢 提交于 2019-12-13 08:25:40
问题 Im trying to play an mp3 audio from url. But when having slow network, player seems like not responding while buffering. So i need to add a progress dialog while buffering . Is it possible.? if yes can anyone help me to do.? public class Player extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_player); Bundle b = new Bundle(); b = getIntent().getExtras(); final String url = b

Stop all media player rinning in my android device

谁说我不能喝 提交于 2019-12-13 08:05:32
问题 I'll like to stopping all media player in my android device programmatically. Someone can help me. 回答1: You should use Service to play MediaPlayer and control from anywhere in application. I used this tutorial and I succeeded. https://thenewcircle.com/s/post/60/servicesdemo_using_android_services 来源: https://stackoverflow.com/questions/21239419/stop-all-media-player-rinning-in-my-android-device

How do I make a mediaPlayer stop when another mediaPlayer starts so that they dont play on top of each other?

≯℡__Kan透↙ 提交于 2019-12-13 07:29:25
问题 I have 2 buttons that both play an mp3. When the first song is playing I want a click of the second song to stop the first song, and start the song that was clicked. also if the first button is pressed twice the second press resets the song. basically I don't want the songs to play on top of each other when multiple buttons are pressed. @Override public void onClick(View v) { switch (v.getId()) { case R.id.placeyouknow: String url = "http://www.katastro.com/audio/facts/01%20That%20Place%20You

Android - Play video in new activity

我们两清 提交于 2019-12-13 07:06:57
问题 I am trying to play a selected video in another activity by passing the fileUri to the next activity. At the moment I click on (Button) findViewById(R.id.pickVid); which calls PICK_VIDEO_REQUEST once the video is selected the new activity opens but the screen is black. I don't think the fileUri is passed correctly, any help please? MainActivity @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Button

Embedded Windows Media Player not streaming avi file?

≡放荡痞女 提交于 2019-12-13 07:00:39
问题 Hi I have a webpage that's using classic ASP that I want to display a streaming video for the user to watch. <OBJECT id='mediaPlayer' width="480" height="428" classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" standby="Loading Microsoft® Windows® Media Player components..." type="application/x-oleobject" codebase="https://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,7,1112"> <param name="fileName" value="VehiclePreOp.avi"> <param name="autoStart" value="True">

Thread and mediaplayer problems, Timer with sound

巧了我就是萌 提交于 2019-12-13 06:44:19
问题 I'm developing an Android application that is based on a timer that every second must play a sound that you selected before. Here is the problem: No objects can run Media Player in a Thread or a Runnable I can not call methods that reproduce the sound I can not run it on a timer task Can you think of anything? Thanks thread: public void run(){ while(!detenido) //Bolean for stop the thread { try { Servicio servicios = new Servicio(); switch(segundosesperar){ //Int to select the ms to slep case