本文整理汇总了C#中MediaState类的典型用法代码示例。如果您正苦于以下问题:C# MediaState类的具体用法?C# MediaState怎么用?C# MediaState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MediaState类属于命名空间,在下文中一共展示了MediaState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: MediaEngine_MediaStateChanged
private void MediaEngine_MediaStateChanged(MediaState state)
{
switch (state)
{
case MediaState.Loading:
this.PlaybackState = PlaybackState.Loading;
break;
case MediaState.Stopped:
this.PlaybackState = PlaybackState.Paused;
break;
case MediaState.Playing:
this.PlaybackState = PlaybackState.Playing;
break;
case MediaState.Error:
this.PlaybackState = PlaybackState.Error_MediaInvalid;
break;
case MediaState.Ended:
this.PlaybackState = PlaybackState.Ended;
break;
}
}
示例2: Sound
public Sound(Game game)
{
this.game = game;
music = new Music();
soundEffect = new SoundEffect();
state = new MediaState();
}
示例3: pauseSoundButton_Click
private void pauseSoundButton_Click(object sender, RoutedEventArgs e)
{
if (state == MediaState.Playing)
{
state = MediaState.Paused;
myMediaElement.Pause();
}
}
示例4: playSoundButton_Click
private void playSoundButton_Click(object sender, RoutedEventArgs e)
{
if ((state == MediaState.Stopped) || (state == MediaState.Paused))
{
state = MediaState.Playing;
myMediaElement.Play();
}
}
示例5: Pause
public static void Pause()
{
if (_song != null)
{
_song.Pause();
_mediaState = MediaState.Paused;
}
}
示例6: Resume
public static void Resume()
{
if (_song != null)
{
_song.Resume();
_mediaState = MediaState.Playing;
}
}
示例7: VideoPlayer
public VideoPlayer()
{
_state = MediaState.Stopped;
_game = Game.Instance;
_platform = (iOSGamePlatform)_game.Services.GetService(typeof(iOSGamePlatform));
if (_platform == null)
throw new InvalidOperationException("No iOSGamePlatform instance was available");
}
示例8: stopSoundButton_Click
private void stopSoundButton_Click(object sender, RoutedEventArgs e)
{
if (state == MediaState.Playing)
{
state = MediaState.Stopped;
myMediaElement.Stop();
}
}
示例9: OnStateChanged
protected override void OnStateChanged(MediaState state)
{
if (state == MediaState.End) return;
if (Album != null)
Album.State = State;
foreach (var artist in Artists)
artist.State = state;
}
示例10: GetTexture
/*
public Texture2D GetTexture()
{
// Coming Soon
throw new NotImplementedException();
// TODO when Xamarin implement the relevant functions return currentFrame;
}
*/
public void Pause()
{
if (_video != null )
{
_video.MovieView.Pause(new NSObject());
_state = MediaState.Paused;
}
}
示例11: playVideoButton_Click
private void playVideoButton_Click(object sender, RoutedEventArgs e)
{
if ((state == MediaState.Stopped) || (state == MediaState.Paused))
{
myMediaElement.Source = new Uri("ms-appx:///Assets/video.mp4", UriKind.RelativeOrAbsolute);
state = MediaState.Playing;
myMediaElement.Play();
}
}
示例12: Play
public static void Play(Song song)
{
if ( song != null )
{
_song = song;
_song.Volume = _volume;
_song.Loop = _looping;
_song.Play();
_mediaState = MediaState.Playing;
}
}
示例13: UmdDevice
public UmdDevice( IEmulationInstance emulator, ComponentParameters parameters )
{
//Debug.Assert( emulator != null );
Debug.Assert( parameters != null );
_emulator = emulator;
_parameters = parameters;
_state = MediaState.Ejected;
_lbnLookup = new Dictionary<long, MediaFile>( 1024 );
}
示例14: initValue
public async void initValue()
{
musicList.Clear();
await getFiles(musicList, folder);
STT = 0;
musicProperties = null;
stream = null;
state = MediaState.STOP;
pb = Playback.ORDER;
rp = Repeat.ALL;
nof = NumOfLoad.FIRST;
}
示例15: SetVideoPlayerState
public void SetVideoPlayerState(MediaState state)
{
switch(state)
{
case MediaState.Paused:
{
this._VideoPlayer.Pause();
break;
}
case MediaState.Stopped:
{
this._VideoPlayer.Stop();
break;
}
default:
break;
}
}