logo

Live Production Software Forums


Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
AgentPete  
#1 Posted : Wednesday, August 7, 2019 1:31:45 AM(UTC)
AgentPete

Rank: Advanced Member

Groups: Registered
Joined: 5/13/2017(UTC)
Posts: 110
Location: London

Thanks: 52 times
Was thanked: 8 time(s) in 2 post(s)
I’m wondering whether anyone has found a way to open the vMix Web browser from a url held in a Data Source (e.g. Excel spreadsheet)?

Currently you have to manually input the URL. Might this be possible via scripting?
doggy  
#2 Posted : Wednesday, August 7, 2019 2:42:04 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,057
Belgium
Location: Belgium

Thanks: 283 times
Was thanked: 916 time(s) in 755 post(s)
Data Sources is for titles, don't see how you could link a webaddress from a datasource to another type of input (browser)

on the other hand have you checked the Shortcut reference list , there is a Browser section that allows you to navigate a browser input. As such this can be used in a script also or externally with the web API (httprequest)
burie  
#3 Posted : Wednesday, August 7, 2019 3:32:31 AM(UTC)
burie

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2019(UTC)
Posts: 54
Germany

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: doggy Go to Quoted Post
Data Sources is for titles, don't see how you could link a webaddress from a datasource to another type of input (browser)

on the other hand have you checked the Shortcut reference list , there is a Browser section that allows you to navigate a browser input. As such this can be used in a script also or externally with the web API (httprequest)

How does this work? It is one of the things I urgently need. Call a website, especially a PHP-script by pressing a key, a shortkey or anything like this. I don't need a input, the script only writes a XML-file, no visible outputs needed.

I have absolutely no idea about VB.NET scripting and new with vmix... so I would be happy and thankful for any help

And NO... a datasource with these PHP-Script is no option because as datasource these script would be refresh second by second but i need it only ONE time.
doggy  
#4 Posted : Wednesday, August 7, 2019 3:50:08 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,057
Belgium
Location: Belgium

Thanks: 283 times
Was thanked: 916 time(s) in 755 post(s)
Quote:
How does this work? It is one of the things I urgently need. Call a website, especially a PHP-script by pressing a key, a shortkey or anything like this. I don't need a input, the script only writes a XML-file, no visible outputs needed.


As mentioned earlier you could do the same by sending the link/url (via shortcut) to you php script from a browser input (just as you would from your regular browser basically)
or learn a little bit of vb.net in how to send a httprequest containing your link and put that in a vMix script and link that to a shortcut
doggy  
#5 Posted : Wednesday, August 7, 2019 3:59:39 AM(UTC)
doggy

Rank: Advanced Member

Groups: Registered
Joined: 12/27/2012(UTC)
Posts: 5,057
Belgium
Location: Belgium

Thanks: 283 times
Was thanked: 916 time(s) in 755 post(s)
If you really want to do that call from within vMix :

browser.JPG (40kb) downloaded 2 time(s).
burie  
#6 Posted : Sunday, August 18, 2019 2:08:57 PM(UTC)
burie

Rank: Advanced Member

Groups: Registered
Joined: 2/18/2019(UTC)
Posts: 54
Germany

Thanks: 5 times
Was thanked: 2 time(s) in 2 post(s)
Originally Posted by: doggy Go to Quoted Post
If you really want to do that call from within vMix :
I know that way to call a website, but if I wanna do two or more things with ONE Shortkey...
I also know to make multiple entries in shortkey list for one key, but I think if one of the entries is "call a website" the other will not be executed.
Anyway... i have found a completely different solution using PHP, so thank you for your help... and this could be closed...

ranz  
#7 Posted : Friday, March 18, 2022 12:56:20 AM(UTC)
ranz

Rank: Member

Groups: Registered
Joined: 3/26/2017(UTC)
Posts: 21

Was thanked: 3 time(s) in 2 post(s)
So I've been playing with this idea also.
In my show I've got to load up a number of youtube videos - which changes every show.
What I ended up doing is similar to the advice above - as follows:

1. Setup google sheets with a column listing the URLs (follow instructions on how to do this in the vMix help docs)
2. Using "Shortcuts" in settings - Create a shortcut to your controller using BrowserNavigate - add the URL (see below)
3. Setup another shortcut to add the video input to your output

I used PHP to grab the link from the Google Sheets:

I named a PHP file "getUrl.php" - placed it on a local VirtualBox that Vmix could see over the LAN

Code here:

Quote:

<?php


$column = $_REQUEST['column'];
$column = $column +1;


$myArray = google_sheet('put your google sheets URL here');
header('Location: ' . $myArray[$column]['C']);
exit;

function google_sheet($url = NULL) {

$array = array();

if ($url):
// initialize curl
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_HEADER, 0);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, TRUE);

// get the spreadsheet data using curl
$sheet = curl_exec($curl);
curl_close($curl);

// find the table pattern and return the mark-up
preg_match('/(<table[^>]+>)(.+)(<\/table>)/', $sheet, $matches);
$data = $matches['0'];

// convert the HTML (XML) mark-up to JSON
$cells_xml = new SimpleXMLElement($data);
$cells_json = json_encode($cells_xml);
$cells = json_decode($cells_json, TRUE);
endif;

// Convert the JSON array to an array of just the table data
// This will strip out any Google Sheets formatting and identifiers if they exist
if ( is_array($cells) ):
foreach ($cells['tbody']['tr'] as $row => $row_data):
$column = 'A';
foreach ($row_data['td'] as $column_index => $cell):
// Check that the cell is populated and get the value.
if (!is_array($cell)):
$array[($row + 1)][$column++] = $cell;
elseif ($cell['div']):
$array[($row + 1)][$column++] = $cell['div'];
endif;
endforeach;
endforeach;
endif;

return $array;
}
?>


I didn't bother too much about security in the script as it is only seen from inside my PC with Vmix running on it.

Back to the "Shortcut" with BrowserNavigate - put the link to your virtualbox php script like:

http://10.0.0.1/getUrl.php?column=1

you can change the column numbers as you add more URL shortcuts (in my case I can sometimes have up to 6) - so you just change the ?column=6 part to reflect which column you want.

The redirect part of the script is a little annoying - but so long as you press it only once on your controller - it should be all set for the show :) - then just queue them up in your preview and away you go :)

oh and I have Column C as my "URL" column in google sheets - you can change this to whatever you like in the code.

Enjoy :)
MartLeib  
#8 Posted : Friday, March 18, 2022 3:41:13 AM(UTC)
MartLeib

Rank: Advanced Member

Groups: Registered
Joined: 2/23/2017(UTC)
Posts: 189
Estonia

Thanks: 1 times
Was thanked: 52 time(s) in 42 post(s)
I would create dummy title and set it's text field using data source. Now I would loop a script every one second to check, is the addresss changed, if it is, navigate browser input using API to that URL. Done.
Users browsing this topic
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.