mirror of
https://github.com/zoriya/Opus.git
synced 2026-06-08 08:20:30 +00:00
Cas notification added.
This commit is contained in:
@@ -12,12 +12,23 @@ namespace MusicApp
|
|||||||
{
|
{
|
||||||
public CastOptions GetCastOptions(Context appContext)
|
public CastOptions GetCastOptions(Context appContext)
|
||||||
{
|
{
|
||||||
//NotificationOptions notification = new NotificationOptions.Builder()
|
NotificationOptions notification = new NotificationOptions.Builder()
|
||||||
// .
|
.SetActions(new List<string> { MediaIntentReceiver.ActionSkipPrev, MediaIntentReceiver.ActionTogglePlayback, MediaIntentReceiver.ActionSkipNext }, new int[] { 1 })
|
||||||
//Customise (or disable) build in notification here.
|
.SetTargetActivityClassName(Java.Lang.Class.FromType(typeof(MainActivity)).Name)
|
||||||
|
.SetSmallIconDrawableResId(Resource.Drawable.MusicIcon)
|
||||||
|
.SetSkipPrevDrawableResId(Resource.Drawable.SkipPrevious)
|
||||||
|
.SetPauseDrawableResId(Resource.Drawable.Pause)
|
||||||
|
.SetPlayDrawableResId(Resource.Drawable.Play)
|
||||||
|
.SetSkipNextDrawableResId(Resource.Drawable.SkipNext)
|
||||||
|
.Build();
|
||||||
|
|
||||||
|
CastMediaOptions media = new CastMediaOptions.Builder()
|
||||||
|
.SetNotificationOptions(notification)
|
||||||
|
.Build();
|
||||||
|
|
||||||
CastOptions options = new CastOptions.Builder()
|
CastOptions options = new CastOptions.Builder()
|
||||||
.SetReceiverApplicationId(CastMediaControlIntent.DefaultMediaReceiverApplicationId)
|
.SetReceiverApplicationId(CastMediaControlIntent.DefaultMediaReceiverApplicationId)
|
||||||
|
.SetCastMediaOptions(media)
|
||||||
.SetStopReceiverApplicationWhenEndingSession(true)
|
.SetStopReceiverApplicationWhenEndingSession(true)
|
||||||
.Build();
|
.Build();
|
||||||
return options;
|
return options;
|
||||||
|
|||||||
@@ -23,7 +23,6 @@ using Com.Google.Android.Exoplayer2.Source.Hls;
|
|||||||
using Com.Google.Android.Exoplayer2.Trackselection;
|
using Com.Google.Android.Exoplayer2.Trackselection;
|
||||||
using Com.Google.Android.Exoplayer2.Upstream;
|
using Com.Google.Android.Exoplayer2.Upstream;
|
||||||
using Com.Google.Android.Exoplayer2.Util;
|
using Com.Google.Android.Exoplayer2.Util;
|
||||||
using Java.Lang;
|
|
||||||
using MusicApp.Resources.values;
|
using MusicApp.Resources.values;
|
||||||
using SQLite;
|
using SQLite;
|
||||||
using Square.Picasso;
|
using Square.Picasso;
|
||||||
|
|||||||
Reference in New Issue
Block a user