مكتبة Android لتسهيل تنفيذ تشغيل الرسائل الصوتية/الصوتية
الخطوة 1. أضفه إلى ملف build.gradle الجذري الخاص بك في نهاية المستودعات:
allprojects {
repositories {
...
maven { url 'https://jitpack.io' }
}
}
الخطوة 2. أضف التبعية
dependencies {
implementation 'com.github.JagarYousef: ChatVoicePlayer :$LATEST'
}
<me.jagar. ChatVoicePlayer library.VoicePlayerView
android:id="@+id/voicePlayerView"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:enableVisualizer="true"
app:visualizationPlayedColor="#ff7700"
app:visualizationNotPlayedColor="#727171"
app:playPauseBackgroundColor="#ff7700"
app:timingBackgroundColor="#6AFF7700"
app:seekBarProgressColor="#000"
app:showShareButton="true"
app:shareCornerRadius="100"
app:playPauseCornerRadius="100"
app:showTiming="true"
app:viewCornerRadius="100"
app:viewBackground="#C6C4CF"
app:progressTimeColor="#000"
app:seekBarThumbColor="#FFC107"
app:shareBackgroundColor="#ff7700"
app:playProgressbarColor="#ff7700"
app:shareText="SHARE ME"/>
voicePlayerView.setAudio(AUDIO_FILE_PATH);
onStop()
// سيؤدي هذا إلى تجنب العديد من الأخطاء إذا قمت باستدعائها في نشاطك onStrop()
onPause()
// إذا كنت لا ترغب في تشغيل الصوت خارج نشاطك/تطبيقك!
setViewBackgroundShape(int color, float radius)
// يجب أن يكون اللون R.color.YOUR_COLOR
setShareBackgroundShape(int color, float radius)
// يجب أن يكون اللون R.color.YOUR_COLOR
setPlayPaueseBackgroundShape(int color, float radius)
// يجب أن يكون اللون R.color.YOUR_COLOR
setSeekBarStyle(int progressColor, int thumbColor)
// يجب أن يكون كلا اللونين R.color.YOUR_COLOR
setTimingVisibility(boolean visibility)
setShareButtonVisibility(boolean visibility)
setShareText(String shareText)
showPlayProgressbar()
hidePlayProgressbar()
refreshPlayer(String audioPath)
MIT License
Copyright (c) 2019 Cergo123
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.