WinCE获取MediaPlayer控件的播放进度和状态

//m_Player.GetCurrentPosition()为当前播放的时间,单位为秒

//m_Player.GetDuration()为总播放时间,单位为秒

double dPercent;//进度(百分比)

dPercent = m_Player.GetCurrentPosition() / m_Player.GetDuration();

long nState;//播放状态

nState=m_Player.GetPlayState();

switch(nState)

{

   case 0://停止

   case 1://暂停

   case 2://正在播放

   case 3://开始播放

   case 6://正在加载

   default:.......;

}

//设置进度:

m_Player.SetCurrentPosition(dPercent*m_Player.GetDuration());

猜你喜欢

转载自blog.csdn.net/llxxhm/article/details/81904558