Media Player 6.4

111222 2004-05-03 09:53:09
Media Player 6.4

1, 怎么获得 01:50 / 03:20 这个播放时间?

2, OnError怎么捕获错误码?

3, OpenState, PlayState的值哪有文档? MSDN上找不到具体值(可能是我没找到)
...全文
22 6 点赞 打赏 收藏 举报
写回复
6 条回复
切换为时间正序
当前发帖距今超过3年,不再开放新的回复
发表回复
111222 2004-05-12
GetDuration是总时长, Position是当前时段
  • 打赏
  • 举报
回复
111222 2004-05-11
wwwllg(wwwllg) :


unsigned long total = (unsigned long)m_pMedia->GetDuration();

为什么total总是334???????
  • 打赏
  • 举报
回复
zhufeng98 2004-05-04
顺便问一下楼主,碰到下面帖子中这种情况没? 我被这个折腾得要死了,就是找不出原因!
http://expert.csdn.net/Expert/topic/3030/3030120.xml?temp=.9810907
  • 打赏
  • 举报
回复
zhufeng98 2004-05-04
// PlayState
// ==============================================================================================================================================
// Value State Description
// 0 Undefined Windows Media Player is in an undefined state.
// 1 Stopped Playback of the current media clip is stopped.
// 2 Paused Playback of the current media clip is paused. When media is paused, resuming playback begins from the same location.
// 3 Playing The current media clip is playing.
// 4 ScanForward The current media clip is fast forwarding.
// 5 ScanReverse The current media clip is fast rewinding.
// 6 Buffering The current media clip is getting additional data from the server.
// 7 Waiting Connection is established, however the server is not sending bits. Waiting for session to begin.
// 8 MediaEnded Media has completed playback and is at its end.
// 9 Transitioning Preparing new media.
// 10 Ready Ready to begin playing.
// 11 Reconnecting Reconnecting to stream.
// ==============================================================================================================================================

来自window media sdk,但是我的实践中数值好像不对,0的状态好像没有,其他状态数值减一!
也就是Stopped状态其实是0,Paused状态是1 ... 以此类推
  • 打赏
  • 举报
回复
UDX协议 2004-05-04
1.long total = (long)m_player.GetDuration();
CString time = GetStringTime(total);
CString CProgramer_EditView::GetStringTime(long sec)
{
int h = 0;
int m = 0;
int s = 0;

if(sec >= 3600)
{
h = sec / 3600;
m = (sec - 3600*h)/60;
s = (sec - 3600*h - 60*m);
}else
{
m = sec/60;
s = sec - 60*m;
}
CString str;
str.Format("%d:%d:%d",h,m,s);
return str;

}

2.TRY{
if(leftvoice == LEFT_SD)
m_vidoHold.m_media.SetBalance(LEFT_SD);
else if(leftvoice == RIGHT_SD)
m_vidoHold.m_media.SetBalance(RIGHT_SD);
else
m_vidoHold.m_media.SetBalance(ALL_SD);
m_vidoHold.m_media.Play();
}
CATCH (COleDispatchException ,e)
{
// AfxMessageBox("格式不对!或不支持此文件");
}
END_CATCH
3.
void CVidoHold::OnPlayStateChangeMediaPlayer(long OldState, long NewState)
{
TRACE("OnPlayStateChangeMediaPlayer\n");
// TODO: Add your control notification handler code here

}
void CVidoHold::OnWarningMediaPlayer(long WarningType, long Param, LPCTSTR Description)
{
TRACE("OnWarningMediaPlayer\n");

}

void CVidoHold::OnEndOfStreamMediaPlayer(long Result)
{
g_play_state = IDLE;
// SetEvent(g_hHandleEvntPlay[PLAYOVER]);
TRACE("OnEndOfStreamMediaPlayer\n");
}
void CVidoHold::OnPlayStateChangeMediaPlayer(long OldState, long NewState)
{
TRACE("OnPlayStateChangeMediaPlayer\n");
// TODO: Add your control notification handler code here

}

  • 打赏
  • 举报
回复
111222 2004-05-04
up
  • 打赏
  • 举报
回复
相关推荐
发帖
ATL
加入

3220

社区成员

ATL,Active Template Library活动(动态)模板库,是一种微软程序库,支持利用C++语言编写ASP代码以及其它ActiveX程序。
申请成为版主
帖子事件
创建了帖子
2004-05-03 09:53
社区公告
暂无公告