当前位置: 首页>>代码示例>>C#>>正文


C# MediaPlayer.SetOnSeekCompleteListener方法代码示例

本文整理汇总了C#中Android.Media.MediaPlayer.SetOnSeekCompleteListener方法的典型用法代码示例。如果您正苦于以下问题:C# MediaPlayer.SetOnSeekCompleteListener方法的具体用法?C# MediaPlayer.SetOnSeekCompleteListener怎么用?C# MediaPlayer.SetOnSeekCompleteListener使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Android.Media.MediaPlayer的用法示例。


在下文中一共展示了MediaPlayer.SetOnSeekCompleteListener方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AndroidMusic

 public AndroidMusic(AssetFileDescriptor afd)
 {
     this.mp = new MediaPlayer ();
     try {
         mp.SetDataSource(afd.FileDescriptor, afd.StartOffset, afd.Length);
         mp.Prepare();
         isPrepared = true;
         mp.SetOnCompletionListener(this);
         mp.SetOnSeekCompleteListener(this);
         mp.SetOnPreparedListener(this);
         mp.SetOnVideoSizeChangedListener(this);
     } catch {
         throw new ApplicationException("Couldn't load music");
     }
 }
开发者ID:Paludan,项目名称:BeerRun,代码行数:15,代码来源:AndroidMusic.cs

示例2: AndroidMusic

        public AndroidMusic(AssetFileDescriptor assetDescriptor)
        {
            mediaPlayer = new MediaPlayer();
            try
            {
                mediaPlayer.SetDataSource(assetDescriptor.FileDescriptor,
                                          assetDescriptor.StartOffset,
                                          assetDescriptor.Length);
                mediaPlayer.Prepare();
                isPrepared = true;
                mediaPlayer.SetOnCompletionListener(this);
                mediaPlayer.SetOnSeekCompleteListener(this);
                mediaPlayer.SetOnPreparedListener(this);
                mediaPlayer.SetOnVideoSizeChangedListener(this);

            }
            catch (Exception e)
            {
                throw new SystemException("Couldn't load music");
            }
        }
开发者ID:Xtremrules,项目名称:dot42,代码行数:21,代码来源:AndroidMusic.cs

示例3: CreateMediaPlayerIfNeeded

		void CreateMediaPlayerIfNeeded ()
		{
			LogHelper.Debug (Tag, "createMediaPlayerIfNeeded. needed? ", (mediaPlayer==null));
			if (mediaPlayer == null) {
				mediaPlayer = new MediaPlayer ();

				mediaPlayer.SetWakeMode (service.ApplicationContext,
					Android.OS.WakeLockFlags.Partial);

				mediaPlayer.SetOnPreparedListener (this);
				mediaPlayer.SetOnCompletionListener (this);
				mediaPlayer.SetOnErrorListener (this);
				mediaPlayer.SetOnSeekCompleteListener (this);
			} else {
				mediaPlayer.Reset ();
			}
		}
开发者ID:Appercode,项目名称:monodroid-samples,代码行数:17,代码来源:Playback.cs

示例4: OnPrepared

		public void OnPrepared (MediaPlayer mp)
		{
			mp.Looping = true;
			int h = mp.VideoHeight;
			int w = mp.VideoWidth;

			mp.SetOnVideoSizeChangedListener (this);
			mp.SetOnBufferingUpdateListener (this);
			mp.SetOnSeekCompleteListener (this);
			mp.SetOnCompletionListener (this);

			int time = vv.Duration;
			int time_elapsed = vv.CurrentPosition;
			pb.Progress = time_elapsed;

			var timer = new CountDown (time, 500);
			timer.Tick += (long millisUntilFinished) => {
				float a = vv.CurrentPosition;
				float b = vv.Duration;

				pb.Progress = (int)(a/b*100);
			};
			timer.Finish += () => {
				Toast.MakeText (this, "Timer Finished", ToastLength.Short).Show ();
			};

			Toast.MakeText (this, "Video Prepared", ToastLength.Short).Show ();
		}
开发者ID:rogeriofabricio,项目名称:XamarinCursoCross,代码行数:28,代码来源:MainActivity.cs

示例5: OnPrepared

                public void OnPrepared( MediaPlayer mp )
                {
                    // now that the video is ready we can hide the progress bar
                    ProgressBar.Visibility = ViewStates.Gone;

                    MediaController.SetAnchorView( VideoPlayer );

                    // setup a seek listener
                    mp.SetOnSeekCompleteListener( this );

                    // log the series they tapped on.
                    MessageAnalytic.Instance.Trigger( MessageAnalytic.Watch, Name );

                    // if this is a new video, store the URL
                    if ( App.Shared.Network.RockMobileUser.Instance.LastStreamingMediaUrl != MediaUrl )
                    {
                        App.Shared.Network.RockMobileUser.Instance.LastStreamingMediaUrl = MediaUrl;
                        VideoPlayer.Start( );

                        // once the video starts, if we're in landscape wide, go full screen
                        if ( MainActivity.IsLandscapeWide( ) )
                        {
                            ParentTask.NavbarFragment.ToggleFullscreen( true );
                        }
                    }
                    else
                    {
                        // otherwise, resume where we left off
                        mp.SeekTo( (int)App.Shared.Network.RockMobileUser.Instance.LastStreamingMediaPos );
                    }
                }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:31,代码来源:NotesWatchFragment.cs

示例6: OnPrepared

                public void OnPrepared( MediaPlayer mp )
                {
                    Rock.Mobile.Util.Debug.WriteLine( "OnPrepared - Audio ready to play" );

                    // now that we know the media player is read, set the controller's player
                    MediaController.SetMediaPlayer( this );
                    MediaControllerPrepared = true;

                    // setup a seek listener
                    mp.SetOnSeekCompleteListener( this );

                    // log the series they tapped on.
                    MessageAnalytic.Instance.Trigger( MessageAnalytic.Listen, Name );

                    // if this is a new video, store the URL
                    if ( App.Shared.Network.RockMobileUser.Instance.LastStreamingMediaUrl != MediaUrl )
                    {
                        App.Shared.Network.RockMobileUser.Instance.LastStreamingMediaUrl = MediaUrl;

                        PlayerState = MediaPlayerState.Playing;
                        mp.Start( );

                        SyncUI( );
                    }
                    else
                    {
                        // otherwise, resume where we left off
                        mp.SeekTo( (int)App.Shared.Network.RockMobileUser.Instance.LastStreamingMediaPos );
                    }
                }
开发者ID:Higherbound,项目名称:HBMobileApp,代码行数:30,代码来源:NotesListenFragment.cs


注:本文中的Android.Media.MediaPlayer.SetOnSeekCompleteListener方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。