本文整理汇总了C#中PlayerController.setLocalPlayer方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerController.setLocalPlayer方法的具体用法?C# PlayerController.setLocalPlayer怎么用?C# PlayerController.setLocalPlayer使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PlayerController
的用法示例。
在下文中一共展示了PlayerController.setLocalPlayer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: setupPlayer
/// <summary>
/// Sets up the media player controller and media information in UI.
/// </summary>
private void setupPlayer()
{
// Displays artist, album name and cover art.
mTitleText.Text = mState.mTitle;
// Starts PlayerController and setups local or remote mPlayerController.
mPlayerController = new PlayerController(this, this, mState.mMediaUri, mState.mSubtitlesUri, mState.mMimeType, mState.mPlayback, mVideoView);
if (mState.mDeviceId == null || mState.mDeviceId.Length == 0)
{
mPlayerController.setLocalPlayer();
}
else
{
mPlayerController.setRemotePlayer(mState.mDeviceId, SmcDevice.TYPE_AVPLAYER);
mDevicePicker.Active = true;
}
// Seeks to given mPosition if requested.
if (mState.mPosition != 0)
{
mPlayerController.seek(mState.mPosition);
}
// Starts playback if requested.
if (mState.mPlayback == PlayerController.PlayerState.PLAYING)
{
mPlayerController.play();
}
Mute = mState.mMute;
// Sets seek bar to media length (in seconds).
// First update via mUpdateEventHandler will set current mPosition.
mSeekBar.Max = mState.mDuration;
mDurationText.Text = convertTime2String(mState.mDuration);
mPositionText.Text = convertTime2String(mState.mPosition);
}
示例2: setupPlayer
/// <summary>
/// Sets up the media player controller and media information in UI.
/// </summary>
private void setupPlayer()
{
// Display artist, album name and cover art.
mTitleText.Text = mState.mTitle;
mArtistText.Text = mState.mArtist;
mCoverArt.ImageURI = mState.mAlbumArtUri;
// Start PlayerController and setup local or remote player.
mPlayerController = new PlayerController(this, this, mState.mMediaUri, mState.mMimeType, mState.mPlayback);
Log.d("MusicPlayer", "setupPlayer");
mPlayerController.setLocalPlayer();
if (mState.mDeviceId == null || mState.mDeviceId.Length == 0)
{
mPlayerController.setLocalPlayer();
}
else
{
mPlayerController.setRemotePlayer(mState.mDeviceId, SmcDevice.TYPE_AVPLAYER);
mDevicePicker.Active = true;
}
// Seek to given position if requested
if (mState.mPosition != 0)
{
mPlayerController.seek(mState.mPosition);
}
// Starts playback if requested.
if (mState.mPlayback == PlayerController.PlayerState.PLAYING)
{
mPlayerController.play();
}
Mute = mState.mMute;
// Set seek bar to media length (in seconds).
// First update via mUpdateEventHandler will set current position.
mSeekBar.Max = mState.mDuration;
mDurationText.Text = convertTime2String(mState.mDuration);
mPositionText.Text = convertTime2String(mState.mPosition);
onStateChanged(mState.mPlayback);
}