本文整理汇总了C#中MediaState类的典型用法代码示例。如果您正苦于以下问题:C# MediaState类的具体用法?C# MediaState怎么用?C# MediaState使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MediaState类属于命名空间,在下文中一共展示了MediaState类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
}
开发者ID:codekaizen,项目名称:internetradio,代码行数:27,代码来源:MediaEnginePlaybackManager.cs
示例2: Sound
public Sound(Game game)
{
this.game = game;
music = new Music();
soundEffect = new SoundEffect();
state = new MediaState();
}
开发者ID:pedert,项目名称:XNA_4_GameOfThreetards,代码行数:8,代码来源:Sound.cs
示例3: pauseSoundButton_Click
private void pauseSoundButton_Click(object sender, RoutedEventArgs e)
{
if (state == MediaState.Playing)
{
state = MediaState.Paused;
myMediaElement.Pause();
}
}
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs
示例4: playSoundButton_Click
private void playSoundButton_Click(object sender, RoutedEventArgs e)
{
if ((state == MediaState.Stopped) || (state == MediaState.Paused))
{
state = MediaState.Playing;
myMediaElement.Play();
}
}
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs
示例5: Pause
public static void Pause()
{
if (_song != null)
{
_song.Pause();
_mediaState = MediaState.Paused;
}
}
开发者ID:adison,项目名称:Tank-Wars,代码行数:8,代码来源:MediaPlayer.cs
示例6: Resume
public static void Resume()
{
if (_song != null)
{
_song.Resume();
_mediaState = MediaState.Playing;
}
}
开发者ID:adison,项目名称:Tank-Wars,代码行数:8,代码来源:MediaPlayer.cs
示例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");
}
开发者ID:patrickdenglerhobbisoft,项目名称:PimpIOs,代码行数:8,代码来源:VideoPlayer.cs
示例8: stopSoundButton_Click
private void stopSoundButton_Click(object sender, RoutedEventArgs e)
{
if (state == MediaState.Playing)
{
state = MediaState.Stopped;
myMediaElement.Stop();
}
}
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:8,代码来源:MainPage.xaml.cs
示例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;
}
开发者ID:Colliotv,项目名称:WMediaPlayer,代码行数:8,代码来源:Track.cs
示例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;
}
}
开发者ID:Breadmouth,项目名称:Gravitas,代码行数:17,代码来源:VideoPlayer.cs
示例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();
}
}
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:9,代码来源:MainPage.xaml.cs
示例12: Play
public static void Play(Song song)
{
if ( song != null )
{
_song = song;
_song.Volume = _volume;
_song.Loop = _looping;
_song.Play();
_mediaState = MediaState.Playing;
}
}
开发者ID:ValXp,项目名称:MonoGame,代码行数:11,代码来源:MediaPlayer.cs
示例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 );
}
开发者ID:BradFuller,项目名称:pspplayer,代码行数:12,代码来源:UmdDevice.cs
示例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;
}
开发者ID:sikyurabmt,项目名称:HQL,代码行数:12,代码来源:MusicManager.cs
示例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;
}
}
开发者ID:vu159951,项目名称:d-r-a-g-o-n-b-a-l-l-c-h-a-o-s,代码行数:20,代码来源:MyVideoPlayer.cs
示例16: PlatformGetState
private void PlatformGetState(ref MediaState result)
{
if (_clock != null)
{
ClockState state;
_clock.GetState(0, out state);
switch (state)
{
case ClockState.Running:
result = MediaState.Playing;
return;
case ClockState.Paused:
result = MediaState.Paused;
return;
}
}
result = MediaState.Stopped;
}
开发者ID:Cardanis,项目名称:MonoGame,代码行数:21,代码来源:VideoPlayer.WMS.cs
示例17: playVideoButton_Click
private void playVideoButton_Click(object sender, RoutedEventArgs e)
{
//myMediaElement.Source = new Uri("ms-appx:///Assets/coffee.mp4", UriKind.RelativeOrAbsolute);
//myMediaElement.Play();
if (state == MediaState.Stopped)
{
myMediaElement.Source = new Uri("ms-appx:///Assets/coffee.mp4", UriKind.RelativeOrAbsolute);
state = MediaState.Playing;
myMediaElement.Play();
}
else if (state == MediaState.Playing)
{
state = MediaState.Paused;
myMediaElement.Pause();
}
else if (state == MediaState.Paused)
{
state = MediaState.Playing;
myMediaElement.Play();
}
}
开发者ID:trilok567,项目名称:Windows-Phone,代码行数:23,代码来源:MainPage.xaml.cs
示例18: VideoPlayer
public VideoPlayer(Game game)
{
_state = MediaState.Stopped;
_game = game;
}
开发者ID:HaKDMoDz,项目名称:Zazumo,代码行数:5,代码来源:VideoPlayer.cs
示例19: SetAdvertisingState
/// <inheritdoc />
protected override void SetAdvertisingState(AdState adState)
#endif
{
var newValue = ConvertAdState(adState);
var oldValue = MediaPlayer.AdvertisingState;
if (newValue != oldValue)
{
#if WINDOWS_PHONE7
if (MediaPlayer.PlayerState == PlayerState.Started || playerState != null)
#else
if (MediaPlayer.PlayerState == PlayerState.Started)
#endif
{
// pause the MediaPlayer if we're playing a linear ad or loading an ad, resume if the opposite
if ((newValue == AdvertisingState.Loading || newValue == AdvertisingState.Linear) && (oldValue == AdvertisingState.None || oldValue == AdvertisingState.NonLinear))
{
#if WINDOWS_PHONE7
playerState = MediaPlayer.GetMediaState();
MediaPlayer.Close();
#else
MediaPlayer.Pause();
#endif
}
else if ((oldValue == AdvertisingState.Loading || oldValue == AdvertisingState.Linear) && (newValue == AdvertisingState.None || newValue == AdvertisingState.NonLinear))
{
#if WINDOWS_PHONE7
MediaPlayer.RestoreMediaState(playerState);
playerState = null;
#else
MediaPlayer.Play();
#endif
}
}
if (newValue == AdvertisingState.Loading)
{
AdContainer.Visibility = Visibility.Visible;
}
else if (newValue == AdvertisingState.None)
{
AdContainer.Visibility = Visibility.Collapsed;
}
// let the MediaPlayer update its visualstate
MediaPlayer.AdvertisingState = newValue;
}
switch (newValue)
{
case AdvertisingState.Linear:
MediaPlayer.InteractiveViewModel = new VpaidLinearAdViewModel(ActiveAdPlayer, MediaPlayer);
break;
case AdvertisingState.NonLinear:
MediaPlayer.InteractiveViewModel = new VpaidNonLinearAdViewModel(ActiveAdPlayer, MediaPlayer);
break;
default:
MediaPlayer.InteractiveViewModel = MediaPlayer.DefaultInteractiveViewModel;
break;
}
}
开发者ID:bondarenkod,项目名称:pf-arm-deploy-error,代码行数:62,代码来源:AdHandlerPlugin.cs
示例20: Tcp_Server_StopVlc
void Tcp_Server_StopVlc(object sender, System.Net.EndPoint e)
{
this.MediaState = MTC_Player.MediaState.Stop;
this.mainClock.Controller.Pause();
myVlcControl.Stop();
}
开发者ID:iceriver102,项目名称:alta-mtc-version-2,代码行数:6,代码来源:Player.xaml.cs
注:本文中的MediaState类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论