CEFSharp3 HTML5 Video

2,296 views
Skip to first unread message

Patrick Robbins

unread,
Feb 19, 2014, 10:53:23 AM2/19/14
to cefs...@googlegroups.com
I'm trying to use a video tag in an app that loads video.  I read that CEF1 has removed support for this, so I downloaded the CEFSharp3 minimal example, and it is not working in this app as well.

I know there are some browser settings that can be adjusted. 

Is it possible to get HTML5 video working in CEFSharp?

While I'm here, would it be possible to expose a file stream through the RegisterJSObject() and play video in the browser?

My other option is to self host a web service to host the video. (or maybe use getusermedia is that is available)

Jørn Hansen

unread,
Feb 19, 2014, 1:00:22 PM2/19/14
to cefs...@googlegroups.com


On Wednesday, February 19, 2014 4:53:23 PM UTC+1, Patrick Robbins wrote:
I'm trying to use a video tag in an app that loads video.  I read that CEF1 has removed support for this, so I downloaded the CEFSharp3 minimal example, and it is not working in this app as well.

I know there are some browser settings that can be adjusted. 

Is it possible to get HTML5 video working in CEFSharp?

Yes it should be possible. I just tried pointing my CefSharp3 clone of CefSharp.Wpf.Example to https://www.youtube.com/html5 - note it reports that it supports WebM format videos but that H.264 isn't supported.
I think I read something on the CEF forum about it. 


While I'm here, would it be possible to expose a file stream through the RegisterJSObject() and play video in the browser?

My other option is to self host a web service to host the video. (or maybe use getusermedia is that is available)

Sorry. I haven't got any experience with that - yet. So here is just a few vague guesses: Maybe you need to look into implementing your own SchemeHandler - or maybe even just enable the file:// protocol (depending on your app requirements)

Best regards,
JornH

Patrick Robbins

unread,
Feb 19, 2014, 2:59:05 PM2/19/14
to cefs...@googlegroups.com
I tried downloading the CEF3 branch, but I'm getting some linker error and I'm not experienced with c++ 

(Error 4 error LNK1181: cannot open input file 'libcef.lib' C:\Users\robbinp\Desktop\CefSharp-CefSharp3\CefSharp\LINK CefSharp
)

I will try to use the pre-release NuGet package in a new test project.

Jørn Hansen

unread,
Feb 19, 2014, 4:49:54 PM2/19/14
to cefs...@googlegroups.com
On Wednesday, February 19, 2014 8:59:05 PM UTC+1, Patrick Robbins wrote:
> I tried downloading the CEF3 branch, but I'm getting some linker error and I'm not experienced with c++ 
>
>
> (Error 4 error LNK1181: cannot open input file 'libcef.lib' C:\Users\robbinp\Desktop\CefSharp-CefSharp3\CefSharp\LINK CefSharp
> )
>
>
> I will try to use the pre-release NuGet package in a new test project.
>

Oops! I got bitten by that one too - and forgot to report it/send in a pull request :(

That .lib file is missing in the https://github.com/cefsharp/CefSharp/tree/CefSharp3/CEF/Win32/Debug folder

Either switch to x64 or Win32/Release - or cheat as I did and copy it over from Win32/Release.
But trying with the pre-release NuGet would also be good. The more people trying it out the sooner the pre- labels can be taken away :-)

Per Lundberg

unread,
Feb 20, 2014, 3:52:22 PM2/20/14
to cefs...@googlegroups.com
Hi,

Please submit an issue about this so we can get it sorted. I'm not sure it's as easy as copying that file, though; don't you get problems with the CRT versions then? You could however check of the libcef.lib are equal for x64/Debug and x64/Release to see if my theory is correct... :)

Best regards,
Per

Jørn Hansen

unread,
Feb 21, 2014, 10:22:15 AM2/21/14
to cefs...@googlegroups.com


On Thursday, February 20, 2014 9:52:22 PM UTC+1, Per Lundberg wrote:
Hi,

Please submit an issue about this so we can get it sorted. I'm not sure it's as easy as copying that file, though; don't you get problems with the CRT versions then? You could however check of the libcef.lib are equal for x64/Debug and x64/Release to see if my theory is correct... :)

I did it after getting "inspired" by the comment in this commit: https://github.com/cefsharp/cef-binary/commit/d966747aba61397f918761073616a9868e0b1448

My plan was to resolve this as part of my work on issue #237 (update CEF to 3.1650 with Chromium 31). So that's why I originally didn't think about creating a separate issue for the missing .lib 

In order not to hijack the original thread see further comments over on issue #237

 

Best regards,
Per

Nathan Sizemore

unread,
Feb 25, 2014, 8:49:23 AM2/25/14
to cefs...@googlegroups.com
If you need support for multiple file types, you can always bring in ffMPEG and connect the stream and decode through C#, and then if you aren't able to read that stream through JS side, you should be able to start stream to a location in on the filesystem, and tell your HTML to load that file, which should be 3-4 seconds delayed.

Nathan

Patrick Robbins

unread,
Feb 25, 2014, 2:23:38 PM2/25/14
to cefs...@googlegroups.com
Thanks.  I had thought about this, but I need real time to show where a person is in a live view to take a high res picture with a camera.

I'm thinking if I can get a stream, I might be able to serve the last frame through an embedded webservice, and call that using javascript to get a reasonable live streaming video.
Reply all
Reply to author
Forward
0 new messages