次の方法で共有


MPMoviePlayerController.ThumbnailImageRequestDidFinishNotification プロパティ

定義

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

プロパティ値

NSString 定数は、NSNotificationCenter のトークンとして使用する必要があります。

属性

注釈

この定数は、 と共 NSNotificationCenter に使用して、この通知のリスナーを登録できます。 これらの値は、実際の文字列コンテンツに対して純粋に使用されるのではなく、一部のネイティブ ライブラリでトークンとして使用できるため、これは文字列ではなく NSString です。 コールバックの 'notification' パラメーターには、通知の種類に固有の追加情報が含まれています。

この通知をサブスクライブするために、開発者は、通知のパラメーターへの厳密に型指定されたアクセスを提供する便利な MPMoviePlayerController.NotificationsObserveThumbnailImageRequestDidFinish メソッド を使用できます。

次の例は、厳密に型指定された Notifications クラスを使用して、通知で使用可能なプロパティから推測を取り出す方法を示しています。

//
// 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 ();
}

次の例は、DefaultCenter API で通知を使用する方法を示しています。

// 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);
}

適用対象