Page 1 of 1

Problem loading a .flv

Posted: Sat Nov 27, 2010 5:05 pm
by c0mas
Greetings,

I'm trying to load a flv from a file and somehow it does not work. Here is the code I'm using:

Code: Select all

CString strFlashMoviePath = dlg.GetPathName();

      if (0 == dlg.GetFileExt().CompareNoCase(_T("swf")))
      {
         //
         TCHAR lpszFlashMoviePath[MAX_PATH + 1] = { 0 };
         lstrcpy(lpszFlashMoviePath, strFlashMoviePath);

         //
         SFPCPutMovie SFPCPutMovie;
         SFPCPutMovie.lpszBuffer = lpszFlashMoviePath;
         ::SendMessage(g_hwndFlashPlayerControl, FPCM_PUT_MOVIE, 0, (LPARAM)&SFPCPutMovie);
      }
      else
      {
         CString strFlashVars = _T("FLVPath=");
         strFlashVars += strFlashMoviePath;
         FPC_PutFlashVars(g_hwndFlashPlayerControl, strFlashVars);
         HMODULE h = GetModuleHandle(NULL);
         ret = FPCPutMovieFromResource(g_hwndFlashPlayerControl, h, _T("FLVPlayer"), _T("SWF"));
      }


I really don't have any clue of what's wrong, FPCPutMovieFromResource just returns FALSE. (the OCX seems to be registered correctly because it plays swf files),

Thanks,
/C.

Re: Problem loading a .flv

Posted: Mon Nov 29, 2010 8:59 am
by Softanics
Hello,

c0mas wrote:HMODULE h = GetModuleHandle(NULL);
ret = FPCPutMovieFromResource(g_hwndFlashPlayerControl, h, _T("FLVPlayer"), _T("SWF"));


Have you included this resource FLVPlayer / SWF into your executable?

Thank you.

Posted: Wed Dec 01, 2010 3:40 pm
by c0mas
I understand now, I need that FLVPlayer.swf in order to play any flv file from disk.

Thanks.

Posted: Wed Dec 01, 2010 3:48 pm
by Softanics
Hello,

Yes, that's right.

Thank you.