Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volume setting not applied to videos #2

Open
Genide opened this issue Feb 11, 2019 · 3 comments
Open

Volume setting not applied to videos #2

Genide opened this issue Feb 11, 2019 · 3 comments

Comments

@Genide
Copy link

Genide commented Feb 11, 2019

The volume slider in the script configuration does not change the volume of played movies. This includes $movie and $movyt. I assume that this issue also includes twitch clips as well. Regardless of what volume this slider is at, the played movies are always at full volume.

image

@Oncorporation
Copy link
Owner

The clips are being played in the browser source, you may be able to adjust volume at the browser source .

I also work on OBS and Streamlabs and will review this on that level.

If that is not reasonable, I will investigate sending a volume indicator to the browser source.

@Genide
Copy link
Author

Genide commented Apr 7, 2019

Is it possible to set the "volume" property on the video tag?

@Genide
Copy link
Author

Genide commented Apr 7, 2019

For the youtube video link, you have to use the youtube iframe APIs to load and manipulate the video and volume.

I manually edited the code and get this somewhat working.
I added the following to the beginning of client.js

var tag = document.createElement('script');
tag.src = "https://www.youtube.com/iframe_api";
var firstScriptTag = document.getElementsByTagName('script')[0];
firstScriptTag.parentNode.insertBefore(tag, firstScriptTag);

function onYouTubeIframeAPIReady() {
  player = new YT.Player('divYT', {});
  var iframe;
  iframe=player.getIframe();
  addClass(iframe, 'hidden');
  addClass(iframe, 'video');
  iframe.width="";
  iframe.height="";
}

And replaced case 'framesrc' with the following

            case 'framesrc':
                 var vidObj = {
                  'videoId': MySet.link,
                  'startSeconds': MySet.start,
                  'endSeconds': (Number(MySet.start) + (MySet.duration / 1000))
                }
                player.loadVideoById(vidObj);
                player.setVolume(30);   // Set volume to whatever it should be here. 0 - 100
                
                removeClass(player.getIframe(), "hidden")
                await timeout(MySet.duration);
                addClass(player.getIframe(), 'hidden');
                await timeout(1000);
                
                callback();
                break;

I also added a div to index.html
<div id="divYT"></div>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants