Compartilhar via


MPMoviePlayerController.ThumbnailImageRequestDidFinishNotification Propriedade

Definição

Constante de notificação para ThumbnailImageRequestDidFinish

[Foundation.Advice("Use MPMoviePlayerController.Notifications.ObserveThumbnailImageRequestDidFinish helper method instead.")]
[Foundation.Field("MPMoviePlayerThumbnailImageRequestDidFinishNotification", "MediaPlayer")]
[ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")]
[ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)]
public static Foundation.NSString ThumbnailImageRequestDidFinishNotification { [ObjCRuntime.Deprecated(ObjCRuntime.PlatformName.iOS, 9, 0, ObjCRuntime.PlatformArchitecture.All, "Use 'AVPlayerViewController' (AVKit) instead.")] [ObjCRuntime.Unavailable(ObjCRuntime.PlatformName.WatchOS, ObjCRuntime.PlatformArchitecture.All, null)] get; }
member this.ThumbnailImageRequestDidFinishNotification : Foundation.NSString

Valor da propriedade

Constante NSString, deve ser usada como um token para NSNotificationCenter.

Atributos

Comentários

Essa constante pode ser usada com o NSNotificationCenter para registrar um ouvinte para essa notificação. Esse é um NSString em vez de uma cadeia de caracteres, pois esses valores podem ser usados como tokens em algumas bibliotecas nativas em vez de serem usados puramente para seu conteúdo de cadeia de caracteres real. O parâmetro 'notification' para o retorno de chamada contém informações extras específicas para o tipo de notificação.

Para assinar essa notificação, os desenvolvedores podem usar o método .ObserveThumbnailImageRequestDidFinish de conveniência MPMoviePlayerController.Notificationsque oferece acesso fortemente tipado aos parâmetros da notificação.

O exemplo a seguir mostra como usar a classe Notifications fortemente tipada para tirar a adivinhação das propriedades disponíveis na notificação:

//
// Lambda style
//

// listening
notification = MPMoviePlayerController.Notifications.ObserveThumbnailImageRequestDidFinish ((sender, args) => {
    /* Access strongly typed args */
    Console.WriteLine ("Notification: {0}", args.Notification);

    Console.WriteLine ("Image", args.Image);
    Console.WriteLine ("Time", args.Time);
    Console.WriteLine ("Error", args.Error);
});

// To stop listening:
notification.Dispose ();

//
// Method style
//
NSObject notification;
void Callback (object sender, MediaPlayer.MPMoviePlayerThumbnailEventArgs args)
{
    // Access strongly typed args
    Console.WriteLine ("Notification: {0}", args.Notification);

    Console.WriteLine ("Image", args.Image);
    Console.WriteLine ("Time", args.Time);
    Console.WriteLine ("Error", args.Error);
}

void Setup ()
{
    notification = MPMoviePlayerController.Notifications.ObserveThumbnailImageRequestDidFinish (Callback);
}

void Teardown ()
{
    notification.Dispose ();
}

O exemplo a seguir mostra como usar a notificação com a API DefaultCenter:

// Lambda style
NSNotificationCenter.DefaultCenter.AddObserver (
        MPMoviePlayerController.ThumbnailImageRequestDidFinishNotification, (notification) => {Console.WriteLine ("Received the notification MPMoviePlayerController", notification); }


// Method style
void Callback (NSNotification notification)
{
    Console.WriteLine ("Received a notification MPMoviePlayerController", notification);
}

void Setup ()
{
    NSNotificationCenter.DefaultCenter.AddObserver (MPMoviePlayerController.ThumbnailImageRequestDidFinishNotification, Callback);
}

Aplica-se a