Handling Media

Having problems with building or using CEF's C/C++ APIs? This forum is here to help. Please do not post bug reports or feature requests here.

Handling Media

Postby Da1TruEcho » Mon Apr 17, 2017 3:58 pm

I'm using CEF 2883 in a multi process setup inside of a Windows MFC application. I want to be able to programatically play/pause/seek mp3 and mp4. Find current playhead position, etc. Is there a way to do this?
Da1TruEcho
Techie
 
Posts: 14
Joined: Sun Mar 05, 2017 9:42 pm

Re: Handling Media

Postby HarmlessDave » Mon Apr 17, 2017 4:04 pm

It might help to know more about what you're trying to accomplish.

Media that is on a website? Normally the web page uses HTML5 or a Flash applet to put the media inside of a player.

Without that, you could do something like intercept the request, stop it from being handled by the browser, save it to a temp file, then use Windows APIs to play the file with some user interface you write in MFC like a modeless dialog. Or pass the file to Windows Media Player and let it handle the UI.
HarmlessDave
Expert
 
Posts: 370
Joined: Fri Jul 11, 2014 2:02 pm

Re: Handling Media

Postby Da1TruEcho » Mon Apr 17, 2017 4:06 pm

It would be for playing local files.
Da1TruEcho
Techie
 
Posts: 14
Joined: Sun Mar 05, 2017 9:42 pm

Re: Handling Media

Postby magreenblatt » Mon Apr 17, 2017 4:09 pm

Unless you're planning to pay for a license to use mp3 in CEF/Chromium you should probably use OS functions for playback.
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm

Re: Handling Media

Postby Da1TruEcho » Mon Apr 17, 2017 4:52 pm

Assuming I acquire a license, is there a way to handle the media through a cefbrowser?
Da1TruEcho
Techie
 
Posts: 14
Joined: Sun Mar 05, 2017 9:42 pm

Re: Handling Media

Postby magreenblatt » Mon Apr 17, 2017 5:10 pm

Da1TruEcho wrote:Assuming I acquire a license, is there a way to handle the media through a cefbrowser?

Yes, use the JavaScript media API: https://developer.mozilla.org/en-US/doc ... diaElement
magreenblatt
Site Admin
 
Posts: 12409
Joined: Fri May 29, 2009 6:57 pm


Return to Support Forum

Who is online

Users browsing this forum: Google [Bot] and 95 guests

cron