This sample demonstrates the use of MediaPlayer
.
Here are some important things this sample highlights:
Seekbar
in the UI.Seekbar
position the MediaPlayer
playback
position is adjusted accordingly.MediaPlayer
are displayed in the UI.raw/res/
folder (no streaming over network).The following articles describe what this sample does in detail:
Copyright 2017 Google Inc. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
compileSdkVersion 25
applicationId "com.example.android.mediaplayersample"
minSdkVersion 25
targetSdkVersion 25
versionCode 1
versionName "1.0"
compile fileTree(dir: 'libs', include: ['*.jar'])
compile 'com.android.support:appcompat-v7:25.4.0'
package com.example.android.mediaplayersample
Allows playback of a single MP3 file via the UI. It contains a {@link MediaPlayerHolder} which implements the {@link PlayerAdapter} interface that the activity uses to control audio playback.