Browser source plugin (1.0-24-g30ce603 2013/5/21)

Status
Not open for further replies.

Muf

Forum Moderator
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

Quick question: Chrome does GPU compositing these days. Does this do that too, or are you uploading the texture from system memory?
 

Shaydo

New Member
Re: Browser source plugin (1.0-9-g9517672 2013/4/23)

Faruton said:
I just fixed the problem with allocation hours ago. I'll post a new version in just a moment.

The 64bit version is possible, but first I have to write a wrapper since the browser I'm embedding (chrome) is a 32bit program only.

I will get a test version of that out as soon as possible.

Works great! No crashes anymore. Thanks!
 

Faruton

Developer
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

The current library just asks for a snapshot and copies it in the dx texture

I could probably speed it up a bit more by rendering directly to the tex, but it is still crossing vid/comp mem barrier twice
 

lio

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

There is a small mistake. unchecking the scene goes blank and the sound will not turn off! as well as works great!
google translate .......
 

Faruton

Developer
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

That is just an artifact of how 'unchecking' of sources work. It doesn't really disable the source, it merely doesn't participate in the scene rendering. So it is still 'running' and the sounds will still come out.

If you want to stop the sound you need to remove the source entirely.
 

lio

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

is there a built-in browser, video player? I tried to send a video (mp4) but I could not! or how to play a video capture in the browser?
 

Faruton

Developer
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

The supported movie file types are webm and anything handled by flash I believe due to licensing reqs
 

adib

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

hmm, if i have an swf in the html page with text that has no background, it will render a blackbox the size of the textbox in flash. Do you guys have an idea on how to fix it, or is it just a odd bug that cant be fixed/is low priority?
 

Faruton

Developer
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

If the swf background is setup as transparent as well as the CSS for the HTML page then it should definitely be working. I've tried multiple examples of exactly this setup that have worked. Also remember to set the body CSS to margins: 0 auto to remove unnecessary border margins.


Remember you can put reference the swf directly an just check the asset wrapping checkbox. If you look at te object embed params you'll notice it specifies transparent there as well.

If you forget any of those three places it may happen that the background is not transparent
 

GuardianX

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

First, Amazing plugin! Been messing around with code for a bit and I think I honestly hit a hard wall in relation to how I wanted to set up my code. Any suggestions would be AWESOME.

Code:
<html>
  <head>
  <style>
      body {
          background-color: rgba(0, 0, 0, 0.65);
          white-space: nowrap;
          overflow: hidden;
          margin: 0px 0px 0px 0px;
      }
      p.ex1 {
          font:22px arial, sans-serif;
          color:rgb(255, 255, 255);
      }  
  </style>
  <script type="text/javascript" src="jquery.js"></script>
  <script type="text/javascript">    
    setInterval('read',3000);
    function read(){
        jquery.get('SongPlayback.txt',
        function(data){$('.contents').html(data);}
        )
        }    
  </script>      

  
  </head>
 <body>
    <p class="ex1">
    Now Playing:<br>
    <div id="contents"></div>
    </p>    
 </body>
</html>

Basically the goal is to combine a couple things, the output from a foobar plugin that clears and writes to a file designated "SongPlayback.txt" and the style formatting of HTML. The issue is, I can't write my HTML in the song file because it clears it's contents every few seconds and I don't think I can write any web type code (HTML, JS, PHP) that can be used. The JS i do have can't be used because, I can't recall the reason. It gives an XMLHTTPrequest error or something, i was told it was because I didn't have a webservice running on my PC, which I kinda understand.

Any alternative thoughts on this would be great. I would LOOOVE to not have to write a plugin for this since I don't even know where to start (granted it may be easier overall. . .).
 

GuardianX

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

Okay I'm going to freak out if it was as simple as I thought it was all along.....

Saw your JS example and am doing some bad hacking atm = /

I feel sorry for people who professionally code if they ever see my work...ever...
 

Faruton

Developer
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

Not a problem :-)I have another example that animates a div from the bottom with easing if that might be useful for you?

I'm on vacation at the moment so I don't have access to the computer that had everything so you would have to wait a couple days

Let me know if you have any problems
 

Faruton

Developer
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

It is planned, but there is some groundwork that needs to be laid first
 

GuardianX

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

Faruton said:
Not a problem :-)I have another example that animates a div from the bottom with easing if that might be useful for you?

I'm on vacation at the moment so I don't have access to the computer that had everything so you would have to wait a couple days

Let me know if you have any problems

In the end I ended up butchering your code a bit to get what I wanted. At one point I had a literal mirror of a portion of your code and it wasn't working. Your code was working fine on it's own something I was doing was making it freak out. I may go through and see if css3 works later so I don't have to marquee.

Code:
<html>
  <head>
  <style>
      body {
          background-color: rgba(0, 0, 0, 0.65);
          margin: 0px 0px 0px 0px;   
      }
      p.ex1 {
          font:18px arial, sans-serif;
          color:rgb(255, 255, 255);
          margin: 0px 0px 0px 0px;
      }  
  </style>
  
  <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  
  <script>
            var previousData;
            function loadText() {
                $.ajax({
                    url: 'SongPlayback.json',
                    beforeSend: function(xhr) {
                        if (xhr.overrideMimeType) {
                            xhr.overrideMimeType("application/json");
                        }
                    },
                    dataType: 'json',
                    success: function(data) {
                        $.each(data, function(key, val) {
                            if (key == 'input') {
                                if (val != previousData) {
                                     previousData = val;
                                    $('#responsecontainer')
                                        .animate({opacity:0})
                                        .queue(function(){
                                             $(this).text(previousData).dequeue()
                                        })
                                        .animate({opacity:1});  
                                }
                            }
                        });
                    }
                });
            }

            setInterval(loadText, 500);

        </script>      

  
  </head>
 <body>
    <p class="ex1">Now Playing:<br>
    </p>
    <marquee direction="left" scrollamount="4">
    <p class="ex1" style="white-space:nowrap; height:25; width:200; margin:0px 0px 0px 0px;" id="responsecontainer"></p>
    </marquee>    
 </body>
</html>

Output from Foobar2000:

Code:
{ "input": "$if($and(%artist%,%title%),%artist% - %title%)$if($and(%title%,$not(%artist%)), %title% )" }


-----

Output to a file named: "SongPlayback.json"
 

dehixem

Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

Change
Code:
url: 'SongPlayback.json',
To
Code:
url: 'asset://local/plugins/BrowserSourcePlugin/PATHTOSongplayback.json'

:)
 

GuardianX

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

Hmmm....why?

I assume you are talking about WITHIN OBS and the plugin settings.

If you are, that looks relatively similar to what you said, except I have it pointing to the HTML file.



So basically, if you combine my previous post code for this plugin and change the output settings if the Foobar2000 plugin to push what I did, this will be the result on your stream:



Essentially it is a constantly refreshing "Now Playing" module that you can edit via HTML. Change the look, feel ect...this also means that if you make a HTML frontend for your stream you can plugin various things to your interface. Basically make your stream look amazing fairly easily.
 

Attachments

  • OBS Plugin 1.JPG
    71.4 KB · Views: 100
  • OBS Plugin 2.JPG
    9.3 KB · Views: 82

GuardianX

New Member
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

I do want to add.

How do you build plugins for this? I see most of them are straight DLL files which likely point to include the files that accompany them but do you just write the plugin in a txt document and then rename it (not likely) I assumed that you'd have to compile the DLL in one manner or another? I've always wanted to be able to controls a tad more with my software and having my own plugin would likely go a long way in a couple areas.

Learning how to script

making the software my own.

Sorry if this isn't the right place to ask, figured I'd throw it in here while people were discussing.
 

Faruton

Developer
Re: Browser source plugin (1.0-11-gfb5082d 2013/4/26)

The source code for my plugin is in the first post
It's quite a bit more difficult than renaming the file as dll

What exactly doesn't work in your example?

You can debug your script by going to http://127.0.0.1:1337

Or you can do it b loading it into google chrome/chromium

When you say 'plugins for this', do you mean the browser plugin? Or OBS in general?

If you have any features you'd like added please let me know
 
Status
Not open for further replies.
Top