This app shows you how you can sync multiple YouTube players across different user sessions on a Miro board.
- Included Features
- Tools and Technologies
- Prerequisites
- Associated Developer Tutorial
- Run the app locally
- Folder Structure
- Contributing
- License
- You have a Miro account.
- You're signed in to Miro.
- Your Miro account has a Developer team.
- Your development environment includes Node.js 14.13 or a later version.
- All examples use
npm
as a package manager andnpx
as a package runner.
This example contains 2 separate apps that are connected by a WebSocket:
- A facilitator app, and
- A participant app. Each app serves different purposes that enable the functionality of the YouTube room.
This app is meant to be installed by only one user: the facilitator of the Miro board. It contains the functionality to start, update, and change a YouTube video. The video is in turn broadcasted and synced across all participants.
This app can be installed by multiple users. It contains the functionality that keeps the YouTube player in sync with the facilitator app.
-
Run
npm install
to install dependencies. -
Run
npm start
to start developing.
Your URL should be similar to this example:http://localhost:3000
-
Create a new Miro app for the facilitator app component.
-
Open the app manifest editor by clicking Edit in Manifest.
In the app manifest editor (see app manifest docs to learn more), configure the the facilitator app as follows:appName: YouTube Room Facilitator sdkUri: "http://localhost:3000/facilitator" scopes: - boards:read - boards:write
-
Create a new Miro app for the participant app component.
-
Open the app manifest editor by clicking Edit in Manifest.
In the app manifest editor, configure the the participant app as follows:appName: YouTube Room Participant sdkUri: "http://localhost:3000/participant" scopes: - boards:read - boards:write
-
From the app settings page, make sure to Install both apps and get both OAuth tokens if you haven't.
-
Open two different Miro boards, one for the facilitator and one for the participant. Make sure each board opens their respective apps. The facilitator app should be opened for the facilitator and the participant app for the participant. Once you have done that, watch the video below to see how to use the app.
.
├── src
│ └── assets
│ └── style.css <-- CSS styles for the app.
│ └── facilitator-modal.js <-- Connects to the WebSocket, and syncronizes other participant apps.
│ facilitator.js <-- Initializes the facilitator app in Miro
│ participant-modal.js <-- Connects to the WebSocket, and syncronizes the YouTube player with the facilitator app.
│ participant.js <-- Initializes the participant app in Miro
├── facilitator-modal.html <-- The HTML for the facilitator app modal
├── facilitator.html <-- The HTML for the facilitator app
├── participant-modal.html <-- The HTML for the participant app modal
├── participant.html <-- The HTML for the participant app
└── server.js <-- The main server. This serves the HTML for both apps. It also initiates the WebSocket.
If you want to contribute to this example, or any other Miro Open Source project, please review Miro's contributing guide.