ofxBerkelium - a webbrowser inside openframeworks

If you haven’t seen it yet, it’s really really amazing, a fully functional browser (google-chromium) integrated in openframeworks with flash, javascript, video-streaming and everything!

-> http://github.com/jefftimesten/ofxBerkelium

sadly currently for MAC only. There are binaries for WINDOWS & LINUX available her -> http://berkelium.org/ , but i know very little about windows & codeblocks. Maybe someone could give me some hints about these window-.dll-things and addon-making, so i could try to build a windows version too…

greetings ascorbin ???

wow amazing… Really nice!

so! i have a working version for windows VS2008 here -> http://www.owimahn.de/discourse/BerkeliumExample.zip

  • its not cleaned up and there are a lot of dll’s and exe’s, i don’t know…it’s my very first project with windows and vs, so i’m sure it could be managed better, but… ITS WORKIN !

greetings ascorbin

Hey, I tried your code in vs2010, in every possible way that I could think out. I am new to VS also. Got this error forever. I think I’ve added the path and linked the file nicely. Do you have have suggestion? Thanks so much!

One possible issue might be: I have no idea where to put the bin folder coming together with your source code.

1> Generating Code…
1>main.obj : warning LNK4075: ignoring ‘/EDITANDCONTINUE’ due to ‘/INCREMENTAL:NO’ specification
1>testApp.obj : error LNK2019: unresolved external symbol “public: void __thiscall ofxBerkelium::setListener(class ofxBerkeliumListener *)” (?setListener@ofxBerkelium@@QAEXPAVofxBerkeliumListener@@@Z) referenced in function “public: virtual void __thiscall testApp::setup(void)” (?setup@testApp@@UAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol “public: __thiscall ofxBerkelium::ofxBerkelium(unsigned int,unsigned int,bool)” (??0ofxBerkelium@@QAE@II_N@Z) referenced in function “public: virtual void __thiscall testApp::setup(void)” (?setup@testApp@@UAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) void __cdecl Berkelium::init(struct Berkelium::WeakString)” (__imp_?init@Berkelium@@YAXU?$WeakString@G@1@@Z) referenced in function “public: virtual void __thiscall testApp::setup(void)” (?setup@testApp@@UAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol “public: class Berkelium::Window * __thiscall ofxBerkelium::getWindow(void)” (?getWindow@ofxBerkelium@@QAEPAVWindow@Berkelium@@XZ) referenced in function “public: virtual void __thiscall testApp::update(void)” (?update@testApp@@UAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol “public: void __thiscall ofxBerkelium::draw(float,float)” (?draw@ofxBerkelium@@QAEXMM@Z) referenced in function “public: virtual void __thiscall testApp::draw(void)” (?draw@testApp@@UAEXXZ)
1>testApp.obj : error LNK2019: unresolved external symbol “public: void __thiscall ofxBerkelium::keyboard(int,bool)” (?keyboard@ofxBerkelium@@QAEXH_N@Z) referenced in function “public: virtual void __thiscall testApp::keyPressed(int)” (?keyPressed@testApp@@UAEXH@Z)
1>testApp.obj : error LNK2019: unresolved external symbol “public: void __thiscall ofxBerkelium::mouseMoved(int,int)” (?mouseMoved@ofxBerkelium@@QAEXHH@Z) referenced in function “public: virtual void __thiscall testApp::mouseMoved(int,int)” (?mouseMoved@testApp@@UAEXHH@Z)
1>testApp.obj : error LNK2019: unresolved external symbol “public: void __thiscall ofxBerkelium::mouseClick(int,int,int,bool)” (?mouseClick@ofxBerkelium@@QAEXHHH_N@Z) referenced in function “public: virtual void __thiscall testApp::mousePressed(int,int,int)” (?mousePressed@testApp@@UAEXHHH@Z)
1>testApp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) void __cdecl Berkelium::Script::toJSON_free(struct Berkelium::WeakString)” (__imp_?toJSON_free@Script@Berkelium@@YAXU?$WeakString@G@2@@Z) referenced in function “public: virtual void __thiscall testApp::onJavascriptCallback(void *,class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<unsigned short,struct std::char_traits,class std::allocator >,class Berkelium::Script::Variant *,unsigned int)” (?onJavascriptCallback@testApp@@UAEXPAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@3@PAVVariant@Script@Berkelium@@I@Z)
1>testApp.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: struct Berkelium::WeakString __thiscall Berkelium::Script::Variant::toString(void)const " (__imp_?toString@Variant@Script@Berkelium@@QBE?AU?$WeakString@G@3@XZ) referenced in function “public: virtual void __thiscall testApp::onJavascriptCallback(void *,class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<unsigned short,struct std::char_traits,class std::allocator >,class Berkelium::Script::Variant *,unsigned int)” (?onJavascriptCallback@testApp@@UAEXPAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@3@PAVVariant@Script@Berkelium@@I@Z)
1>testApp.obj : error LNK2019: unresolved external symbol “__declspec(dllimport) struct Berkelium::WeakString __cdecl Berkelium::Script::toJSON(class Berkelium::Script::Variant const &)” (__imp_?toJSON@Script@Berkelium@@YA?AU?$WeakString@G@2@ABVVariant@12@@Z) referenced in function “public: virtual void __thiscall testApp::onJavascriptCallback(void *,class std::basic_string<char,struct std::char_traits,class std::allocator >,class std::basic_string<unsigned short,struct std::char_traits,class std::allocator >,class Berkelium::Script::Variant *,unsigned int)” (?onJavascriptCallback@testApp@@UAEXPAXV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@V?$basic_string@GU?$char_traits@G@std@@V?$allocator@G@2@@3@PAVVariant@Script@Berkelium@@I@Z)
1>.\bin\KinectSDKandOF.exe : fatal error LNK1120: 11 unresolved externals
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Thanks for that approach ofxBerkelium!

I got it to work in VS 2010:
https://dl.dropbox.com/u/51937459/erdgas-zuerich-uwa-2012.zip

I still can’t find out how to display a local html file.
Does anybody know how to do that?

Maybe reading a local file would work if you used your localhost so that berkelium loads it just as it would any external site. On windows I’ve used xampp ( http://www.apachefriends.org/en/xampp.html ) before to get a local web server running quickly. On linux + mac it’s really simple as well.

I thought about that workaround, too.
It still seems strange that I can’t show a local html file.
Chromium doesn’t have a problem with it.
Maybe it’s a security issue?

have you try this

  
urls.push_back("file://"+ofToDataPath("example.html",true));  
urls.push_back("file:///Users/kingsinjameskong/Dropbox/_Project/PV3DPlane_Sample.html");  
  

it work for me even *.swf file
like this

  
urls.push_back("file://"+ofToDataPath("example.swf",true));  

and i found that if you want to load swf to Berkelium
you should better use “swfObject”
http://code.google.com/p/swfobject/
which is javascript class to help you loading the swf file to html

what i am going to do is copy the sample and change the canvas size of the swf

  
  
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "[http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">](http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">)  
<html xmlns="[http://www.w3.org/1999/xhtml"](http://www.w3.org/1999/xhtml") lang="en" xml:lang="en">  
	<head>  
		<title>SWFObject 2 dynamic publishing example page</title>  
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />  
		<script type="text/javascript" src="swfobject.js"></script>  
		<script type="text/javascript">  
		swfobject.embedSWF("example.swf", "myContent", "2048", "764", "9.0.0", "expressInstall.swf");  
		</script>  
	</head>  
	<body id="myContent" style="background=0xffffff;">  
		<div>  
			<h1>Alternative content</h1>  
			<p><a href="[http://www.adobe.com/go/getflashplayer"><img](http://www.adobe.com/go/getflashplayer"><img) src="[http://www.adobe.com/images/shared/download-buttons/get-flash-player.gif"](http://www.adobe.com/images/shared/download-buttons/get-flash-player.gif") alt="Get Adobe Flash player" /></a></p>  
		</div>  
	</body>  
</html>  
  

hope this help

Oh god, I’m so …
The problem with the local file was a stupid VS setting.
The local file works now!

anyone has a working version for of 0074 osx 10.8 ?

greetings ascorbin