CLR Browser Source Plugin [OBS Classic ONLY]

HappyAshes

New Member
Hi Faruton!
Great plugin you got there :D

But the only thing I REALLY wanted to do with this plugin was to show my webcam in a circle through <video> with getUserMedia and CSS with border-radius. Its working in my browser but its not showing in OBS.
I'm guessing its because of the need for allowing CLR Browser to use my webcam but I can't make it work with a variety of settings.

That's why I'm here to get some help, is it just not implemented yet (getUserMedia) or there is no way to allow CLR to use my webcam?

Thanks in advance for your answer :D
(sorry for the way my sentences are constructed, I'm french :P)
 

Faruton

Developer
Hi Faruton!
Great plugin you got there :D

But the only thing I REALLY wanted to do with this plugin was to show my webcam in a circle through <video> with getUserMedia and CSS with border-radius. Its working in my browser but its not showing in OBS.
I'm guessing its because of the need for allowing CLR Browser to use my webcam but I can't make it work with a variety of settings.

That's why I'm here to get some help, is it just not implemented yet (getUserMedia) or there is no way to allow CLR to use my webcam?

Thanks in advance for your answer :D
(sorry for the way my sentences are constructed, I'm french :P)

Okay! I got this working by going into Settings->Browser->Runtime Tab->Core Section->CommandLineArguments

Click on the String[] Array and you'll see a [...] button appear; click on that

You should see this
Code:
--no-proxy-server

And you need make it look like this
Code:
--no-proxy-server
--enable-media-stream

After restarting OBS you should be able to capture your webcam
 
Last edited:

HappyAshes

New Member
Thank you! :D

But its not working, well there is a huge improvement: my webcam's led is working, therefor, CLR is using it! But strangely, it doesn't want to show it...

I'm guessing its because I'm using wampServer with localhost url (userGetMedia doesn't work through local .html file path). I tried with a simple Hello text file and it doesn't show it everytime (I have to change the width/height and sometimes it does show, sometimes it doesn't). And the webcam doesn't "activate" when using the Hello text file so its not the newly added command-lines which activate it automatically so it does read the html file containing my webcam...

Kinda strange in my opinion.. I thought it may be because of using localhost.. I have no clue xD

Edit: Its definitely not showing my webcam. I put a text inside the webcam file and its showing the text but not the webcam. I guess it needs more command-lines? There is the script I'm using:

Code:
<script>
var video = document.querySelector("#videoElement");
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
if (navigator.getUserMedia) {      
    navigator.getUserMedia({video: true}, handleVideo, videoError);
}
function handleVideo(stream) {
    video.src = window.URL.createObjectURL(stream);
}
function videoError(e) {
  
}
</script>

I hope it'll help you!
 
Last edited:

Sapiens

Forum Moderator
@ball2hi I can assure you Desert Kharon works fine as I use it with the new CLR Browser without a problem, so it really does sound like an issue on your end. It looks like you're trying to use the 64-bit version of OBS, are you sure you installed the correct version of the plugin as well as the 64-bit version of the msvcrt dependency? Can you test with the 32-bit version of OBS to see if you get the same behavior?
 

Faruton

Developer
@ball2hi I can assure you Desert Kharon works fine as I use it with the new CLR Browser without a problem, so it really does sound like an issue on your end. It looks like you're trying to use the 64-bit version of OBS, are you sure you installed the correct version of the plugin as well as the 64-bit version of the msvcrt dependency? Can you test with the 32-bit version of OBS to see if you get the same behavior?
We resolved this issue on IRC. It seems to have been a 64bit issue running Windows 7 (without SP1).

Installing SP1 solved the problem
 
Last edited:

Faruton

Developer
Thank you! :D

But its not working, well there is a huge improvement: my webcam's led is working, therefor, CLR is using it! But strangely, it doesn't want to show it...

I'm guessing its because I'm using wampServer with localhost url (userGetMedia doesn't work through local .html file path). I tried with a simple Hello text file and it doesn't show it everytime (I have to change the width/height and sometimes it does show, sometimes it doesn't). And the webcam doesn't "activate" when using the Hello text file so its not the newly added command-lines which activate it automatically so it does read the html file containing my webcam...

Kinda strange in my opinion.. I thought it may be because of using localhost.. I have no clue xD

Edit: Its definitely not showing my webcam. I put a text inside the webcam file and its showing the text but not the webcam. I guess it needs more command-lines? There is the script I'm using:

Code:
<script>
var video = document.querySelector("#videoElement");
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia || navigator.oGetUserMedia;
if (navigator.getUserMedia) {    
    navigator.getUserMedia({video: true}, handleVideo, videoError);
}
function handleVideo(stream) {
    video.src = window.URL.createObjectURL(stream);
}
function videoError(e) {

}
</script>

I hope it'll help you!

Try checking "Intercept request and apply template" and use this for the template

Code:
<html>
  <head>
    <meta charset='utf-8'/>
    <script>
      navigator.webkitGetUserMedia(
      {
        video: true
      },
      function handleVideo(stream)
      {
        var video = document.querySelector("#videoElement");
        video.src = window.URL.createObjectURL(stream);
        video.play();
      },
      function videoError(e) {});
    </script>
  </head>
  <body>
    <video id="videoElement"/>
  </body>
</html>
 

HappyAshes

New Member
I tried and it doesn't work (while your script works in Chrome) but I think I know why... Its doesn't even take in count the <video> element

Let me explain:
I put a text under the <video> element and its showing it at the top while #videoElement have height: 1080px;, so even if the video isn't showing, it should still be "there", I even tried with a grey background and its not showing. I removed my <video> element and reloaded the page and my webcam led was activated (only because the script allow and accept CLR to use it) but the video element isn't working :D

Its really strange, your description says that <video> is working :o (I'm using the 32bits version by the way).
 

Faruton

Developer
The script I sent worked on my machine (video showed up and everything).

Did you download the 20140909 release which was posted yesterday? or the 07?

Is there anything in the dev console? Settings->Browser->Runtime->Debug port, set that to 1234 or whatever and restart obs.

Open up http://127.0.0.1:1234 and select the browser that is open. If you then choose the console tab you can see if any errors occurred.

(You can also F5 to refresh the source to cause the loading to happen again)
 

HappyAshes

New Member
I'm such a moron x) Didn't saw there was a new version.. It's working perfectly now :D

Thanks for your help and your time! Such a great support! I was afraid to be forced to use XSplit next to it using XSplit's webcam output, put a green layer around my webcam and use the chromakey in OBS to get what I wanted ! :D

Amazing plugin, as a webdeveloper and webdesigner, I'm excited to experiment some crazy stuff :D

Thank you again for your help and this plugin! ;D
 
Hi Faruton, Thanks for your great plugin. Everything works perfectly with the last update.
I do have a small question about some errors in my logfile and basicly want to know if its possible to clean those up a bit?

The log shows the following:

08:44:45: CLR host plugin strings not found, dynamically loading 4 strings
08:44:45: CLRHost::Initialize() attempting to load and start the .NET runtime (null)
08:44:45: CLRHost::Initialize() Found version v2.0.50727 .NET runtime
08:44:45: CLRHost::Initialize() Found version v4.0.30319 .NET runtime
08:44:45: CLRHost::Initialize() attempting to use v4.0.30319 .NET runtime
08:44:45: CLRHost::LoadInteropLibrary() load the assembly plugins\CLRHostPlugin\CLRHost.Interop.dll
08:44:45: CLRHost::LoadPlugins() attempting to load the plugin assembly CLRBrowserSourcePlugin
08:44:45: CLRHost:: Could not find/load browser settings at location C:\Users\Gebruiker\AppData\Roaming\OBS\pluginData\browser.json
08:44:45: CLRHost:: Exception: System.IO.FileNotFoundException: Kan bestand C:\Users\Gebruiker\AppData\Roaming\OBS\pluginData\browser.json niet vinden.
08:44:45: Bestandsnaam: C:\Users\Gebruiker\AppData\Roaming\OBS\pluginData\browser.json
08:44:45: bij System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
08:44:45: bij System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
08:44:45: bij System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize, FileOptions options, String msgPath, Boolean bFromProxy)
08:44:45: bij System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
08:44:45: bij CLRBrowserSourcePlugin.Shared.BrowserSettings.Reload()
08:44:45: CLRHost::LoadPlugins() successfully added CLR plugin [Type: CLRBrowserSourcePlugin.CLRBrowserSourcePlugin, Name: CLR Browser Source Plugin]
08:44:53: CLR host plugin instance deleted; removing dynamically loaded localization strings

so it's basicly that it can not find browser.json in AppData\Roaming\OBS\pluginData as far as i can see.
(This is with a fresh install of OBS and the CLR plugin + dependency's)

What would be the best approach to solve this?
 

Faruton

Developer
As I mentioned earlier this is not a fatal error. As soon as the config is recreated (changing something in settings->browser), the error will go away
 

Indyaner

New Member
Is it possible to use the Flash Webcam Features as well (they need a manual click to allow the use of the webcam, so the question basicly is if the new version supports click events)
 

Faruton

Developer
Open up the site in question with firefox and click 'Allow' to the web cam usage. Then right click->Settings->Remember and it should be added to the a security list global to the computer (including the CEF browser).

Having said this, I HIGHLY recommend using the built in webrtc method of retrieving video from a webcam. An example can be found above
 

moziklol

New Member
I installed CLR in to C:\Program Files (x86)\OBS\plugins for the 32 bit and when I tried the 64 bit I installed it in to C:\Program Files (x86)\OBS\64bit\plugins but neither time did I get the option to add it as a source in OBS. I know that I opened the correct OBS and that I downloaded and installed the appropriate version. Anyone have any idea why it's not showing up?
 

onscreen

New Member
Hi,
I override the twitch chat with CLR browser CSS via below

.chat_line {
font-size: 18px !important;
line-height: 18px !important;
font-family: Stratum2-Bold !important;
color: #E4E0E7 !important;
}

However after updating to the latest CLR Browser version I am unable to use this font, it works with other fonts however, has something changed in regards to the loading of fonts?
 
Top