Click here to Skip to main content
6,595,854 members and growing! (17,696 online)
Email Password   helpLost your password?
Platforms, Frameworks & Libraries » Mobile Development » General     Intermediate

Video Streaming in Pocket PC 2002

By Tuan Nguyen

An article on creating a Streaming Video Player for Pocket PC
C++, eVC 3.0, Windows, Win Mobile (PocketPC 2002), Visual Studio, Dev
Posted:20 Apr 2004
Views:98,379
Bookmarked:37 times
Announcements
Loading...
 
Search    
Advanced Search
Add to IE Search
printPrint   add Share
      Discuss Discuss   Broken Article?Report  
12 votes for this article.
Popularity: 3.96 Rating: 3.67 out of 5
2 votes, 16.7%
1

2
1 vote, 8.3%
3
5 votes, 41.7%
4
4 votes, 33.3%
5

Introduction

This project introduces you to use Microsoft Media Player SDK to write a simple video player for Pocket PC 2002

Background

  • Embedded Visual C++ 3.0

Using the code

  • First, download the SDK and install to the system. It would be in the directory C:\WMSDK\WMPktPC\
  • Open the sample project: C:\WMSDK\WMPktPC\Samples\MediaBookmarker\MediaBookmarker.vcw

The sample project present how to play a video file locally. To play a video through http we must use the additional functions provided in PlayerOCX.h. First look at the CMediaBookmaker.h to see the variables

CComPtr<IWMP> m_spWMPPlayer; // A pointer to the 

  //Windows Media Player control interface

To play an video file we can use the function Play() like this

m_spWMPPlayer->Play();

Second, create a text box for user enter the URL

LRESULT CMediaBookmarker::OnCreate(UINT uMsg, 
   WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
..........
..........
..........
h_editURL=CreateWindow(TEXT("EDIT"), 
  TEXT("http://www.somewhere.com/video.wmv"), 
  WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL| BS_TEXT, 
  0, 20, 220, 20, m_hWnd, (HMENU)IDB_TXT_ADDRESS, hInst, NULL);

//

CreateWindow(TEXT("BUTTON"), TEXT("Go"), 
  WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 
  220, 20, 20, 20, m_hWnd, (HMENU)IDB_GO, hInst, NULL); 


h_btnAbout=CreateWindow(TEXT("BUTTON"), TEXT("MediaBookmarker"), 
  WS_CHILD | WS_VISIBLE | BS_PUSHBUTTON, 
  0, 40, 240, 20, m_hWnd, (HMENU)IDB_ABOUT, hInst, NULL);
..........
..........

}

The variable h_editURL was declared in the CMediaBookmaker.h

HWND h_editURL; // the handle for Edit box 

Then we create the function that handle the action click on the button Go (CMediaBookmaker.h )

BEGIN_MSG_MAP(CMediaBookmarker)
   .....
   .....
   .....
   COMMAND_ID_HANDLER( IDB_GO, OnGoURL)
   .....
   .....
END_MSG_MAP()

LRESULT OnGoURL( WORD wNotifyCode, WORD wID,
  HWND hWndCtl, BOOL& bHandled);

Then back to the CMediaBookmarker.cpp to edit the function OnGoURL

LRESULT CMediaBookmarker::OnGoURL(WORD wNotifyCode, WORD wID, 
  HWND hWndCtl, BOOL& bHandled)
{
 CHAR *m_strURL="";

 //h_editURL

 SendMessage(h_editURL,WM_GETTEXT,256,(LPARAM)m_strURL);
 // Send a windows message to get the value of the textbox in the program. 


 SendMessage(h_btnAbout,WM_SETTEXT,256,(LPARAM)m_strURL);
 // Set the Text in Button About to test . Do not need to use this code 


 // And finally use put_FileName() function to prepare to play

 m_spWMPPlayer->put_FileName((unsigned short*)m_strURL); 

 m_spWMPPlayer->Play(); // Play the media from the URL 


 return 0;
}

Points of Interest

This code was tested on the Acer n10 Pocket PC 2003 using SENAO wireless card. We can play the file remotely in the web server.

I am just a new comer. I have many difficulties when doing the video project on Pocket PC. Now I find this code is interesting and would like to share with you. Finally, thanks for your concerns !

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Tuan Nguyen


Member

Location: Vietnam Vietnam

Other popular Mobile Development articles:

  • Writing Your Own GPS Applications: Part 2
    In part two of the series, the author of "GPS.NET" teaches developers how to write GPS applications suitable for the real world by mastering GPS precision concepts. Source code includes a working NMEA interpreter and sample high-precision application in C# and VB.NET.
  • Writing Your Own GPS Applications: Part I
    What is it that GPS applications need to be good enough to use for in-car navigation? Also, how does the process of interpreting GPS data actually work? In this three-part series, I will cover both topics and give you the skills you need to write a commercial-grade GPS application.
  • Learn How to Find GPS Location on Any SmartPhone, and Then Make it Relevant
    A step by step tutorial for getting GPS from any SmartPhone, even without GPS built in, and then making location useful.
  • iPhone UI in Windows Mobile
    It's an interface that works with transparency effects. As a sample I used an interface just like the iPhone one. In this tutorial I am explaining how simple is working with transparency on Windows Mobile.
  • Pocket 1945 - A C# .NET CF Shooter
    An article on Pocket PC game development
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 33 (Total in Forum: 33) (Refresh)FirstPrevNext
Generalvideo Pinmembersalam ellayan23:54 16 Nov '08  
Generalvideo streaming Pinmembersalam ellayan22:26 19 Jul '08  
GeneralWindows mobile 2003 media player codding needed urgently in C# Pinmembersuppersunny070:22 29 Jun '08  
Generalpocket pc Media Player Control in C# Pinmemberfita845:46 16 Mar '08  
QuestionQueryControl failed Pinmemberamou6422:15 21 Nov '07  
QuestionRe: QueryControl failed PinmemberJessn10:22 4 Feb '09  
AnswerRe: QueryControl failed Pinmembersc.valentine2118:29 26 Apr '09  
AnswerRe: QueryControl failed PinmemberJessn8:54 5 May '09  
GeneralI'm unable to control UI of VideoStream/ MediaBookmarker Pinmembersatishknagineni7:35 29 Aug '05  
Generalfatal error RC1015: cannot open include file 'winver.h'. PinmemberBigDog11121:31 17 May '05  
GeneralRe: fatal error RC1015: cannot open include file 'winver.h'. Pinmemberchrisharden4:35 22 Aug '05  
GeneralRe: fatal error RC1015: cannot open include file 'winver.h'. Pinmemberkrishind_996:18 14 Sep '06  
Generalmouse event Pinmemberjloc20:19 1 Mar '05  
Generalplayer for pocket pc 2003 Pinmembergoast23:11 15 Sep '04  
GeneralRe: player for pocket pc 2003 Pinmemberarvish272:20 13 Oct '04  
GeneralRe: player for pocket pc 2003 Pinmemberarvish272:24 13 Oct '04  
GeneralSupported newer windows media format (9/10) ? Pinmemberalien-star22:55 11 Sep '04  
GeneralAny one did it in .NET PinmemberGuma16:40 29 Jul '04  
GeneralRe: Any one did it in .NET PinsussAnonymous10:28 22 Dec '04  
GeneralRe: Any one did it in .NET Pinmembersoundararajandpm1:58 15 Dec '06  
GeneralRe: Any one did it in .NET Pinmembermshahidm6:25 11 Sep '09  
GeneralLinking Error Pinmembersiuchi_fchan0:39 14 Jul '04  
GeneralRe: Linking Error PinsussAnonymous13:06 19 Jul '04  
GeneralRe: Linking Error Pinmembersiuchi_fchan22:56 19 Jul '04  
GeneralRe: Linking Error Pinmemberindex4913:40 20 Jul '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 20 Apr 2004
Editor: Nishant Sivakumar
Copyright 2004 by Tuan Nguyen
Everything else Copyright © CodeProject, 1999-2009
Web22 | Advertise on the Code Project