Sample for Streaming a FLV URL passed from C++?

DLL Edition of the F-IN-BOX
Jim W.
Posts: 14
Joined: Fri Feb 03, 2006 7:20 pm
Location: Atlanta, GA, USA
Contact:

Sample for Streaming a FLV URL passed from C++?

Postby Jim W. » Fri Feb 03, 2006 7:28 pm

We are evaluating flashplayercontrol for our app. We need to have our C++ code control the FLVs that are being played. I have a swf that will play a flv passed in as a url=... parameter, which works fine on a web page.

<embed src="320x240.swf" Flashvars="url=http://localhost/flv/HaveGunWillTravelSea.flv" width="320" height="240" name="320x240" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />

But if I load the same SWF from C++, set the flash param with FPCM_PUT_FLASHVARS it doesn't work. I just get a Flash logo screen with a downloading of the FLV and nothing happens. On the web page I get the same screen for a fraction of a second before the flv starts playing. Any ideas?

I altered your sample using GlobalOnLoadExternalResourceHandler, which works, but doesn't stream since it loads the entire file before returning the stream.

Thanks,
Jim W.

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Re: Sample for Streaming a FLV URL passed from C++?

Postby Softanics » Sat Feb 04, 2006 10:42 am

Thank you for your question.

Jim W. wrote:But if I load the same SWF from C++, set the flash param with FPCM_PUT_FLASHVARS it doesn't work.


A flash movie uses this flash variables at startup. If a movie is already loaded, FPCM_PUT_FLASHVARS doesn't work. The solution is to use FPCM_PUT_FLASHVARS before loading a movie.
Best regards, Artem A. Razin,
F-IN-BOX support
Ask your question here: http://www.f-in-box.com/support.html

Jim W.
Posts: 14
Joined: Fri Feb 03, 2006 7:20 pm
Location: Atlanta, GA, USA
Contact:

Postby Jim W. » Mon Feb 06, 2006 12:18 pm

I tried before and after. I changed sample1's code around line 281 to the code below and I just get a progress bar saying it's loading the flv, so it got the parameter, but it doesn't play it. We're playing with the VideoSpark player, which you can get here (320x240.swf) http://www.videospark.com/prog_flv8/pla ... t1.flv&p=1

Any ideas?

//
SFPCPutMovie SFPCPutMovie;
SFPCPutMovie.lpszBuffer = lpszFlashMoviePath;
PutFlashVars( m_hwndFlashPlayerControl, "url=http://localhost/flv/HaveGunWillTravelSea.flv");
::SendMessage(m_hwndFlashPlayerControl, FPCM_PUT_MOVIE, 0, (LPARAM)&SFPCPutMovie);

Jim W.
Posts: 14
Joined: Fri Feb 03, 2006 7:20 pm
Location: Atlanta, GA, USA
Contact:

Postby Jim W. » Mon Feb 06, 2006 4:16 pm

More info. I built my own flv player using the directions at
http://www.reallyshiny.com/articles/a-q ... eo-player/

and again, it works fine in the browser. When loading via flashplayercontrol, the flv never plays. The control just show the throbber. I added dynamic text to show the flashparams, and it is correct, so it is getting set. Is there some kind of permission thing where flashplayer control can't or is failing to download the file? I tried setting the flash var with and without quotes, but just can't get it to work.

Can you post a sample the streams an flv from a URL?

BrianWeed
Posts: 4
Joined: Fri Oct 28, 2005 7:42 pm

Postby BrianWeed » Tue Feb 07, 2006 2:20 pm

This is how we play a SWF that streams a FLV via FlashVars...


m_hFlash = ::CreateWindow(WC_FLASH, NULL, WS_CHILD | WS_VISIBLE, 0, 0, GetWidth(), GetHeight(), (HWND)CxWindowApp::GetApp()->GetHandle(), NULL, (HINSTANCE)CxApp::GetApp()->GetInstanceHandle(), NULL);

if (m_hFlash != NULL) {

HRESULT hr;

if (pszFlashVars != NULL) {
hr = FPC_PutAllowScriptAccess((HWND)m_hFlash, "always.");

hr = FPC_PutFlashVars((HWND)m_hFlash, pszFlashVars);
}

hr = FPC_LoadMovie((HWND)m_hFlash, 0, pszFileName);

hr = FPC_Play((HWND)m_hFlash);
}

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Feb 07, 2006 3:11 pm

This issue is fixed. Please download last version.
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Tue Feb 07, 2006 6:23 pm

In the last build we added streaming feature. It is experimental now. We are testing it and the next release will include this feature officially. For demonstrating the streaming, the project "Sample8_SecureFlashContentLoading" is added. It demonstrates how to provide Flash content (swf or flv) is a separate thread.
Please write me about bugs here or to support (at) flashplayercontrol.com
Thank you!
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Jim W.
Posts: 14
Joined: Fri Feb 03, 2006 7:20 pm
Location: Atlanta, GA, USA
Contact:

Postby Jim W. » Tue Feb 07, 2006 8:59 pm

Thanks. I got the update my initial tests look better. I am getting an C0000005 exception in your DLL that you must catch, when running my swf

Softanics
Site Admin
Posts: 1402
Joined: Sat Sep 18, 2004 3:03 am
Location: Russia, St. Petersburg
Contact:

Postby Softanics » Wed Feb 08, 2006 9:25 am

Jim W. wrote:Thanks. I got the update my initial tests look better. I am getting an C0000005 exception in your DLL that you must catch, when running my swf


Only under debugger? Or this exception is occured if you run compiled EXE without debugger? What is version of Flash you use?
Could you please help me and test the demo EXEs which are included in this ZIP:
http://flashplayercontrol.com/download/ ... AppExe.zip
Thank you in advance!
Best regards, Artem A. Razin,

F-IN-BOX support

Ask your question here: http://www.f-in-box.com/support.html

Jim W.
Posts: 14
Joined: Fri Feb 03, 2006 7:20 pm
Location: Atlanta, GA, USA
Contact:

Postby Jim W. » Wed Feb 08, 2006 1:40 pm

You update seems to really help, thanks. Before I could not play any FLVs in the FlashDemo, but now they work.

Since it is caught, you can only see it in the debugger. I tried the exes you sent and they don't do it. I took your latest FlashTexture demo and loaded my swf that plays an FLV and it throws the exception, which is caught, but it goes on. Loading your sample movie does not throw the exception. Here's the stack.

> ntdll.dll!7c91347e()
kernel32.dll!7c80b908()
kernel32.dll!7c8399f3()
FlashPlayerControl.dll!1001cf3e()
FlashPlayerControl.dll!1000ff8f()
FlashPlayerControl.dll!10009126()
user32.dll!77d48734()
user32.dll!77d48816()
user32.dll!77d4b89b()
user32.dll!77d5f39a()
user32.dll!77d5f3e3()
FlashPlayerControl.dll!10003323()
FlashPlayerControl.dll!1000442e()

I'm not sure the best way to tell what version of flash I'm using. I installed 8. The swsupport.dll that gets loaded is 10.1.0.11


Return to “DLL Edition”

Who is online

Users browsing this forum: No registered users and 13 guests

cron