<mr-video>
The <mr-video>
tag is used to embed a video in an MRjs page.
Definition and Usage
Videos are not technically inserted into a web page; images are linked to web pages. The <mr-video>
tag creates a holding space for the referenced video.
The <mr-video>
tag has two required attributes:
src
- Specifies the path to the videoalt
- Specifies an alternate text for the video, if the video, for some reason, cannot be displayed, or if the user uses a screen reader.
Example
Play
Stop
mr-panel {
display: block;
align-items: center;
justify-content: center;
width: 100vw;
height: 100vh;
}
mr-video {
position: absolute;
align-self: center;
object-fit: cover;
}
#tabbar {
background-color: #141414;
border-radius: 1%;
position:fixed;
bottom: 0;
left: 0;
width: 50%;
display: grid;
grid-template-columns: 1fr 1fr 1fr 1fr;
padding: 1vh;
height: fit-content;
z-index: 4;
}
#tabbar * {
margin: 0 10px;
}
let vid = document.querySelector('#vid');
function playVideo() {
vid.play();
}
function stopVideo() {
vid.pause();
}