media-player

Keeping notification from dismissing when service is destroyed in Oreo

流过昼夜 提交于 2020-07-05 03:29:29
问题 Okay. I had a question regaurding keeping Media Player Services in Android Oreo. Based on the discussion here: Android Oreo: Keep started background service alive without setting it foreground (but with a notification)? It seems the proper way to handle Media player services in Android Oreo is to store state information when the media player is paused so if it is destroyed, pressing play will create a new media player and start where it left off. My question is how do I create a notification

How to get system's closed caption font size?

不羁岁月 提交于 2020-06-17 15:47:29
问题 I want to get system's closed caption font style, and I referd doc. So far everything is good, except the font size. According to doc, ClosedCaptionProperties.FontSize returns enum ClosedCaptionSize , see code switch (Windows.Media.ClosedCaptioning.ClosedCaptionProperties.FontSize) { case Windows.Media.ClosedCaptioning.ClosedCaptionSize.FiftyPercent: richtextblock.FontSize = 50; break; case Windows.Media.ClosedCaptioning.ClosedCaptionSize.OneHundredPercent: richtextblock.FontSize = 100; break

How to evolve a seekbar from the place where media player has been paused?

喜你入骨 提交于 2020-05-17 06:56:41
问题 I have in connection a seekbar and a button alone used for play / pause. the principle is functional, when i press the button, it starts to play and in a second time when i press it pauses mediaplayer (perfect). The problem is when I press again so that it continues reading, the reading starts again from the beginning instead of continuing from the place where it had been paused. Please direct me, here is my code : PLAY_SONG private void play_songs() { mediaPlayer = new MediaPlayer(); if

Detect if audio is playing in browser Javascript

本小妞迷上赌 提交于 2020-04-08 09:08:25
问题 Is there a global way to detect when audio is playing or starts playing in the browser. something like along the idea of if(window.mediaPlaying()){... without having the code tied to a specific element? EDIT: What's important here is to be able to detect ANY audio no matter where the audio comes from. Whether it comes from an iframe, a video, the Web Audio API, etc. 回答1: No one should use this but it works. Basically the only way that I found to access the entire window's audio is using

media player classic - jump to point in video/audio programmatically

天涯浪子 提交于 2020-02-23 11:31:09
问题 In Media Player Classic I found a way to jump to a point in a video/audio programmatically, avoiding the Go To... box. The jump distances are available at Options → Tweaks , and HKEY_CURRENT_USER\Software\MPC-HC\MPC-HC\Settings ( JumpDistL / JumpDistM / JumpDistS ). What I do is find the jump distances in the address space of Media Player Classic, and set the value of the large jump distance such that if you applied it to the elapsed time you would get the desired time. I then send a WM

Android SDK Media Recorder. State 4

两盒软妹~` 提交于 2020-02-23 05:37:50
问题 I'm just at the end of developing a quick Android App. Minor problem. What's state 4? I'm using MediaPlayer and every time I run the app I get an error stating that Media Player "start()" is first called in state 0, then state 4. Does anyone know what state 4 is? I can figure out the problem if I know the states such as state 1 and 2... Thanks, 回答1: This is from MediaPlayer.h in the Android source: enum media_player_states { MEDIA_PLAYER_STATE_ERROR = 0, MEDIA_PLAYER_IDLE = 1 << 0, MEDIA

Android SDK Media Recorder. State 4

醉酒当歌 提交于 2020-02-23 05:35:48
问题 I'm just at the end of developing a quick Android App. Minor problem. What's state 4? I'm using MediaPlayer and every time I run the app I get an error stating that Media Player "start()" is first called in state 0, then state 4. Does anyone know what state 4 is? I can figure out the problem if I know the states such as state 1 and 2... Thanks, 回答1: This is from MediaPlayer.h in the Android source: enum media_player_states { MEDIA_PLAYER_STATE_ERROR = 0, MEDIA_PLAYER_IDLE = 1 << 0, MEDIA

List installed media players

北慕城南 提交于 2020-02-06 05:29:37
问题 I'm trying to get a list of all apps that can handle media installed on Android. I've tried the methods listed here, but none of them worked. They all return an empty list and I have multiple media players installed, which are all recognized by Headset Droid (https://play.google.com/store/apps/details?id=tvk.headvol). Can anybody suggest any alternative method or might have and idea what the problem can be? Do I need to set any permissions? 回答1: Here is what I came up with: PackageManager

which way is the best for playing 5 songs in android app?

浪子不回头ぞ 提交于 2020-01-25 06:48:08
问题 I have 5 songs that must be played in my app, I locate them in raw resource folder. how can I play them? please give me the best way. I use default player or use mediaplayer.start() ? I use 5 buttons to show them and play them. public class MusicActivity extends AppCompatActivity implements View.OnClickListener{ private MediaPlayer a,b,c,d,e; private Button aBTN,bBTN,cBTN, dBTN ,fBTN; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

MediaPlayer pausing and playing error

帅比萌擦擦* 提交于 2020-01-25 01:22:16
问题 I'm building an application for Android with Java and XML. The user of the app must be able to listen to a tune and also pause it. So I made one button with which you can play and pause the tune. I made a function in which the src of the ImageView must be changed. However Eclipse gives me an error at the mp.start() and the mp.pause() , which says: "mp cannot be resolved" . I don't know what I'm doing wrong right now and I hope somebody can help me. Java code: import android.media.MediaPlayer;