How to play a Muted embedded Youtube Video

i’m looking how to use THIS solution in Hype.

I already checked this one, but it’s not my case:

The solution you point to also mention the API will be depriciated at some point
A new API can be found on the same page you provided…!!

Unfortantly we are not mind readers or remote viewers. :slight_smile:
What is your case?

Sorry, probably I wasn’t clear…

I already found the solution you linked here (and many others…), but as the link I posted in the topic, I dunno how to implement it inside Hype. That’s my problem…

About the Last line (It’s not my case) I thought It was clear, my case is “Muted Embedded Youtube video” and Not as the link below… No need to be “remote viewers”…

What I mean is we can offer solutions but without an idea of your actual setup it would all be guess work, leading to more questions.

Please post something to show what you are doing and why the current solutions do not work for you.

There isn’t an actual set up. Simply I don’t know how to set this ( in Hype…That’s it…“Play a Muted Embedded Youtube Video in Hype” (the topic’s title)

I’m not a dev (That’s why I use Hype :wink: ) so it’s not easy for me (and for others Hypers too) to set a JS solution inside Hype…You know what i mean?
Probably my english is bizzarre, sorry about that…I’ll try like that:

Playing Muted Youtube video --> API Youtube JS solution --> Implement in Hype = How to do it?

Ok. (12.0 KB)

This is a straight transplant of it into Hype.

The main functions are placed in a Hype function.

The Player DIV is inside the innerHTML of the rectangle element in the scene.
The API is linked in the head.

But I am not sure you will understand any of that…

1 Like

YES!!! Thanks! It works!!! That’s exactly what I would to do!

that’s the result of your solution! Thanks!

Cosa, nessun londra :scream:

:smiley: what??

Hey guys,
in the example file that @MarkHunte posted, how would I go about triggering a command to tell the video to pause when a custom button is pressed.

Right now I named the rectange ‘video1’ and am triggering this code on click of another rectangle (button graphic): hypeDocument.getElementById(‘video1.player’).stopVideo();
This does not work.

Make sure the video rectangle has an id.

In this example it is video1

We have the button run a Hype function that runs

	var playerIFrameID = "video1";
	var palyPause = element.innerText


palyPause == 'Pause' ? (
  element.innerText =   'Play'
) : (
   element.innerText =   'Pause'   
	 var youtube_command = window.JSON.stringify( { event: 'command', func: palyPause.toLowerCase() + 'Video' } );
   document.getElementById(playerIFrameID).firstElementChild.contentWindow.postMessage( youtube_command, '*' );

player (14.6 KB)


Excellent. Just needed to make sure the function exists ha.
Thank you so much!