Set Video Ringtone For Incoming Calls on Android - android

i have designed a call screen by using the concept of broadcast receiver.my requirement is to implement a video call screen,so that when some one calls to my device at that time a video file will be played in the call screen and previous normal ringtone will be stopped.

Related

When my Android audio player is in background, how do I do stuff as the song progresses?

For example, I want to send a notification that the next line is coming up to an external device that shows lyrics.
I tried setting RemoteControlClient.setPlaybackPositionUpdateListener, but the listener is never called.

Android ExoPlayer demo: continue playback with screen locked

I want to modify the ExoPlayer demo to allow audio playback to continue when the screen gets locked (this should work regardless of whether the media being played is audio or video). Based on some hints (e.g. 1, 2) this is what I came up with so far:
https://github.com/google/ExoPlayer/compare/release-v2...sedubois:background-playback
This is directly based on the ExoPlayer demo code, currently in version 2.12.1. It adds a "foreground" permission, registers a service, and creates a notification in that service (according to the documentation this notification is required for background playback). The service is started when initializing the player.
I can start the player and the demo looks as illustrated below with an audio stream. At this point the notification gets created properly, it shows the player details (title, description, progress bar) and control buttons (see picture below), which work (I can play/pause, restart from the beginning and skip backwards/forwards).
However the playback still stops when I minimize the application or when I lock the screen by pressing the power button. What is the proper way to make this work?
Just to make sure we are on same page. I'm testing on dev-v2 branch of exoplayer repo here
onStop() method in PlayerActivity.java is releasing player, So when app goes in background then onStop() is being called and it is releasing player with method releasePlayer.
If you'll comment out that method i.e. dont release player in onStop(), then player will play in background.

Unable to play media player in Background

I have Implemented A media player But the Problem is that when i press back button .music stop.but it runs when the app is in background.
Proper approach is to implement media-player inside service. That way music playback will persist when users uses other applications or gets outside of your app.
Remember to call startForeground() with ongoing notification.

how to know when audio is started playing in android

In my application I want to get start time of music player when user started and end time when it stops.I don't want to start any music player in my app. I just want to track user activity in device. So i want my application to get any notification when user started the music .
Do I get any intent for music player started and it stopped.Or do I get any intent for when user opens music files.
Is there any other method other than intent to capture the start time and and time when user starts music player.
Well you can implement the interface 'AudioManager.OnAudioFocusChangeListener' in which there is a method 'onAudioFocusChange' which lets you know if audio focus has been changed, and it can also tell if focus was gained or lost.
See this link, it explains the Audio Focus in detail. An application must gain audio focus through a request, and you can implement the 'AudioManager.OnAudioFocusChangeListener' and if there is focus gain, you can detect if the media player is running, (because some other application such as you tube may gain focus to play its audio), see this to see how to detect which application or service is currently running. You can find if audio has started to play, and if it was the media player or not.
Hope this helps. It was interesting question and I have learned some new things while searching for the answer!

Handling Interrupt in my Android application

Hi I am developing an application that play video in android player.
But i am stuck in between. I used videoView to play video on that.
But inbetween if any incomming call, incomming message come that after
by video can not be resume.
Even if battery low message come than also i can't resume my video.
What exactly happens when you return to the screen from the interrupt? You could save the "state" of the playback in internal storage and resume to the point at which it was before. Try utilizing the onResume and onStop methods of your activity.
Check the first image here for more http://developer.android.com/reference/android/app/Activity.html

Categories

Resources