How to Play A Random Video from A Folder Using Streamer.Bot (Websocket v5.x)
Автор: Geefbird
Загружено: 2024-04-13
Просмотров: 2377
Описание:
** UPDATE **
While you can still use this I have made a better version that is easier to set up and offers better functionality, as well as comes in 6 variations which can be found by watching this video
here - • Random Video From Folder 2.0
For all you cool cats out there trying to set up one media source and have all of your videos pulled through it, run your own randomized ads, or do any other type of stuff using the Random Video from Folder action but couldn't get it to work since the updates to websockets (yea, a lot of people don't even realize that is why it doesn't work anymore) I have completely rebuilt the action for use with current v5.x websockets. So here you go, enjoy.
- - C# CODE (copy and paste this into execute C# code sub-action) - - -
using System;
using System.IO;
public class CPHInline
{
public bool Execute()
{
var rand = new Random();
var myDirectory = args["videoFolder"].ToString();
var files = Directory.GetFiles(myDirectory,"*.*");
var myfile = files[rand.Next(files.Length)];
CPH.SetArgument("randomVideo", myfile);
return true;
}
}
- - OBS RAW CODE (copy and paste this into OBS RAW sub-action) - - -
{
"requestType": "SetInputSettings",
"requestData": {
"inputName": "Random Video Player",
"inputSettings": {
"local_file": "%randomVideo%"
},
"overlay": true
}
}
Thank you for watching! Hope you found this video helpful and I hope you stick around for more videos.
Come catch a live stream sometime!
@ / geefbird
Повторяем попытку...
Доступные форматы для скачивания:
Скачать видео
-
Информация по загрузке: