This article is mainly about the architecture of the most important and complex media Player (MediaPlayer) in Android. For Android, a complete and relatively complex system, the implementation of a MediaPlayer function is not a function of its specific features, but a specific feature how to adapt to the Android system
I recently saw an article about audio. I suddenly remembered a friend from China Media University who asked me to help her design a program that can play the input audio in real time, I thought of using DirectSound at the time, but I felt a little scared about such things that I never touched, in addition, we use a language such as C # To write this relatively low-level thing, so this thing is gone. Fortunately, later this friend successfully complete
This article translated from: http://developer.android.com/training/managing-audio/volume-playback.html
Good user experience is predictable. If your application needs to play multimedia, it is vital that you can use the hardware or software of your device to control the volume, such as Bluetooth headsets or microphones.
Similarly, when appropriate, your application should provide media playback operations s
1. Concepts and extensions
Videoview is a media playback display and Control control provided by the Android system. Its structure is as follows:
Prototype: videoview extendsSurfaceviewImplementsMediacontroller.Mediaplayercontrol
Class Structure:
Java. Lang. ObjectUsing Android. View. ViewUsing
Now let's talk about playing ringtones in the Android system. From the framework level, let's talk about the playing principle of ringtone. I encountered a problem in playing system ringtones in the android source code, so I carefully studied this knowledge. Now I have sorted it out and provided some help to the readers. Now I am very friendly in playing and setting ringtones, whether it is for text message
In Android, you can play a video in three ways:
1. Use its own player. Specify action as action_view, data as Uri, and type as its MIME type.
2. Use videoview for playback. In the layout file, use videoview and mediacontroller to control it.
3. Use the mediaplayer class and surfaceview. This method is flexible.
1. Call its own player:
Uri uri = Uri. parse (environment. getexternalstoragedirectory (). getpa
return value. Release the MediaPlayer object.Method: reset ()Explanation: no return value. Reset the MediaPlayer object.Method: seekTo (int msec)Explanation: there is no return value. It specifies the playback position in milliseconds)Method: setAudioStreamType (int streamtype)Explanation: no return value indicates the streaming media type.Method: setDataSource (String path)Explanation: no return value. Se
As an application developer, you can use any media codecs in any format that are valid on Android devices for free, including the codecs provided by Android platforms and devices. However, it is best to use a device-independent Media Encoding configuration file.
Network Protocol
The following network protocols are supp
Objective
Vitamio is our team's good faith, in addition to the Vplayer to make the best Android player, but also to the Vitamio to create the best player components Android. The new release of the Beta SDK although there are some problems, but already have a high scalability, convenience and many built-in practical functions, follow-up articles will continue to dig and introduce the use of Vitamio details
A Preliminary Study on Android Development Video Playback
/*
* Android development: Video Playback
* Beijing Android Club group: 167839253
* Created on: 2011-8-24
* Author: blueeagle
* Email: liujiaxiang@gmail.com
*/
There are some differences between video
Android multimedia playback API introduction, androidapi
This article calls the android Media Player to play some music.
Project Layout:
You can view files in the local sdk and view related APIs.
File :///...... /Sdk/docs/guide/topics/media/mediaplayer.html
URL: http://www.
music.
You can modify the current audio stream volume by receiving a key message from the volume control key. However, this is not necessary. Android provides a convenient setVolumeControlStream () method to automatically adjust the volume based on the specified audio stream.
First, determine the audio stream that your application will use, and then set it as the current focus audio stream through the setVolumeControlStream method.
This method should
In Android, you can play a video in three ways: the first method is to use mediaplayer and surfaceview to play the video, and the mediaplayer is used to control the playback, pause, and progress of the video, surfaceview is used to display the video content. The second method is to use videoview for playback. This class actually inherits the surfaceview class and
[Chapter 1-buffer playback on the android platform] buffer play demo,-androidbuffer
From the source code of various android versions released by google, android has implemented interfaces and Demos supporting buffer playback. After compiling the
Android supports video recording and playback and android recording.
To achieve a similar small video function, you can record a video and then play the video.
Video Recording, using a custom control.
Video Playback:
Layout file:
Required System permissions:
You can achieve the basic video recording func
work:
Multi-track and subtitle support
Granular CPU and GPU optimization
Support mobile phone to tablet various devices
Streaming media playback buffering support
Playback screen proportional size adjustable 1
Automatic text encoding detection, refuse garbled
There are more new features not listed, please refer to the official w
The logic of a video playback under Android is just part of the activity logic sourceDemoactivity:public class Demoactivity extends Activity implements Onclicklistener {EditText Et_path;Button Bt_start;Button Bt_pause;Button Bt_restart;Button Bt_stop;Surfaceview SV;Surfaceholder Holder;MediaPlayer player;@Overrideprotected void OnCreate (Bundle savedinstancestate) {Super.oncreate (savedinstancestate);Setcon
)Rate playback rate (1.0 = normal playback, range 0.5 to 2.0)
To use SoundPool to play a sound, follow these steps:
Call the SoundPool constructor to create the SoundPool object.
Call the load () method of the SoundPool object to load the sound from the specified resource, file, it is best to use HashMap
To manage the loaded sounds
Call the play method of SoundPool to play the sound.
Example pro
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.