Jump to content

[TOPIC: topicViewTemplate]
[GLOBAL: userSmallPhoto]
Photo

Awesomium and libVLC
Started by StarCrunch Aug 23 2016 11:46 AM

2 replies to this topic
awesomium libvlc webview video win32 osx
[TOPIC CONTROLS]
[/TOPIC CONTROLS]
[modOptionsDropdown]
[/modOptionsDropdown]
[reputationFilter]
[TOPIC: post.html]
#1

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 803 posts
  • Corona SDK

Hi.
 
These are a couple WIPs of projects that might be useful to some (desktop, mostly) developers.
 
Awesomium
 
Awesomium is an HTML UI engine. The attached library lets you stuff a little web canvas (an object along the lines of what graphics.newTexture() gives you) onto a display object, approximating a webview.
 
At the moment this only supports some mouse events. Adding other events looks straightforward, if a bit
time-consuming. Honestly, I'm not sure how I'll devote much more attention to this project (Awesomium itself hasn't updated in quite some time; I also got the impression Windows webviews are on Corona's radar, e.g. based on some hints dropped on the last After Dark), but maybe what's here already would be usable to some.
 
This is Windows-only.
 
libVLC
 
"libVLC is the core engine and the interface to the multimedia framework on which VLC media player is based."
 
This one follows a similar design. A video is fed through another display object.
 
I'm more likely to see this one through. So far there are only Windows and OSX builds, though in this case it's just because I haven't gotten to anything else. An obvious first step will be making its rather provisional API more like Corona's video objects, then fleshing it out some. (I'm not sure how much work it would take to get something that was reasonably complete. Quite a lot of the VLC API seems targeted toward its use as a self-standing media player, from what I can see, which wouldn't really be my goal.)
 
Both libraries operate via display objects, thus putting them in Corona's display hierarchy.
 
Usage
 
For Awesomium, it goes something like this. (I haven't touched it a little over a month, so these steps might be a bit rusty.)
 
Follow the installation directions here and check that the AWE_DIR environment variable is set up appropriately. Scroll down to the section labeled Copy files to your build distribution. What I did was find those files in the Awesomium exe's directory and copy them into the directory of the Corona executable. (If there is a better way it would be good to know!) I don't know if I ever tested with a build, but I presume you'd do the same alongside the exe there. (And your installer should probably check for Awesomium.)
 
You can put awesomiumc.dll (the "c" simply avoids a clash with Awesomium's own DLL) in
<YOUR PATH TO HERE>\AppData\Roaming\Corona Labs\Corona Simulator\Plugins\plugin.
 
As for libVLC, what I've found so far is this:
 
On Windows, install VLC and set the VLC_PLUGIN_PATH environment variable to point to its plugins folder.
 
Copy the libvlc and libvlccore DLLs to Corona's exe folder, as with Awesomium. Likewise, with a build, add those two in the same way.
 
Again following Awesomium's lead, add video.dll (this should probably have a better name) to the <YOUR PATH TO HERE>\AppData\Roaming\Corona Labs\Corona Simulator\Plugins\plugin directory.
 
I experimented with adding VLC's plugins folder to the build in hopes of not requiring the application to be installed. What I then get is a litany of "entry point for procedure not found" errors... though if you click through them things seem to carry on fine. Not sure what's up.  :)
 
I'm not certain VLC needs to be installed on OSX. In any case, go here (this fellow's work has been invaluable, on both OSes!) and grab one of the newest releases ending with "VLC_v2.2.4_x64_osx.tar.gz".
 
In this case, you can go to ~/Library/Application Support/Corona/Simulator/Plugins/plugin and dump video.dylib, along with the lib folder found in the previous step's tarball.
 
For a build, what I did was add a Plugins folder alongside Frameworks, MacOS, etc. in the app contents and then dumped the lib folder there, along with the dylib (either renamed plugin_video or added to a plugin folder there).
 
Phew!
 
(This is a lot at once, but I'd like to get it out there and see if I can get some feedback.)
 
I've attached my test files for the two libraries.

  • Danny and Develephant like this

[TOPIC: post.html]
#2

Rob Miracle

[GLOBAL: userInfoPane.html]
Rob Miracle
  • Moderator

  • 25,660 posts
  • Enterprise

Just to clarify.  WebViews on Windows is a popular request. The team understands the popularity and need but they also understand the difficulty and all the other things you would like for us to do. For now, continue to vote for this feature here:

 

http://feedback.coronalabs.com/forums/188732-corona-sdk-feature-requests-feedback/suggestions/14483499-native-web-views-for-windows-simulator-and-builds

 

Rob



[TOPIC: post.html]
#3

StarCrunch

[GLOBAL: userInfoPane.html]
StarCrunch
  • Contributor

  • 803 posts
  • Corona SDK

Windows WebViews!

 

By sheer coincidence, it was brought to my attention a few days back that I apparently didn't include the links for the binaries here.  :mellow:

 

Anyhow, in case it's still useful, here's the Awesomium DLL. libVLC's, with a couple new changes, is here. (Will try to update the dylib too, when I've got a chance.) Test project for both here.

 

I haven't updated the test project to reflect this, but for libVLC I added a Runtime event with the name "vlc_video_done". Its object field will give you back the video handle if it ends.

 

Because it's LGPL, libVLC isn't a real candidate for the plugin marketplace (I might try to do something with more liberally-licensed stuff, say libtheora and friends), but I'm considering open-sourcing both it and Awesomium, if I find some time to set it all up.




[topic_controls]
[/topic_controls]

Also tagged with one or more of these keywords: awesomium, libvlc, webview, video, win32, osx