Guides: Discover Mux Player: Quick Start Guide

0:00

Hey everyone, I'm Dylan with Mux and today we are going to

0:03

get started with Mux Player.

0:06

Mux Player is a drop in web component for doing video

0:10

playback with Mux assets in your web application.

0:16

Let's jump into it.

0:18

So first, I'm going to start here in the Mux dashboard.

0:20

You Um, may already have assets in your Mux dashboard,

0:24

and normally you'd probably be creating assets with API

0:28

calls, but just to speed things up, I'm going to

0:31

create one here directly in the dashboard and I'll just

0:34

use the default, um, Mux intro video to create that.

0:39

So this is the asset I just created.

0:41

Um, now, uh, let's drop in, drop in Mux player into a

0:45

web application that I have.

0:47

So I'm going to need this playback ID.

0:49

So let me just copy that real quick to my clipboard.

0:52

And I go here.

0:54

I have this.

0:55

This is a kind of default code sandbox, just

0:58

plain HTML application.

1:00

So first thing I need to do here is install Mux

1:03

player as a dependency.

1:06

And that's an app Mux slash Mux player on NPM.

1:10

I'm going to go over to this index.

1:12

I don't need this code.

1:13

And then let me just.

1:15

import here, um, at Mux, Mux player.

1:21

Okay.

1:21

So now I've imported the package into my HTML,

1:25

and I'm going to change this to just be an H1.

1:28

Hello, Mux player.

1:32

Save that.

1:32

Okay.

1:34

Um, all set up.

1:36

Now let's jump over to the Mux player docs here.

1:39

And in this quick start, see, I've already installed it.

1:43

Uh, this is the HTML code to get started.

1:45

So I'm just going to jump over here and Let's just

1:50

paste that, um, that code, but I want to use, I'm going

1:54

to use this playback ID from the Mux dashboard and

1:58

just drop that in there.

1:59

Okay.

2:01

Save that.

2:01

Um, see, that's the asset I just created.

2:03

And right now, um, that's it.

2:06

That's everything I have to get to get started.

2:08

Everything's working out of the box.

2:10

And really all I needed was that one playback

2:12

ID, one line of code.

2:13

And right now I have this fully functional video player.

2:16

You can see on small screens, the controls are overlaid

2:18

on top of the player.

2:19

As I go to a larger screen, Those controls,

2:22

um, rearrange and shift down to the control bar.

2:25

The defaults are all, all here baked in for you.

2:28

Playback rate, you can speed up the video.

2:31

Jump forward and jump back by 10 seconds.

2:33

And this would work with a live playback ID.

2:36

If it's a live stream, then you'll get a UI that's live.

2:39

Um, you set to specify with the stream type that it's

2:41

live and also Chromecast is enabled by default.

2:44

So if I have a Chromecast connected, I'll see the

2:46

Chromecast control Airplay is enabled by default.

2:49

Let's actually jump over to Safari to see.

2:54

Airplay.

2:57

So load this, this web app in Safari.

3:00

And you can see I have the Airplay control here.

3:02

Um, so everything, you just kind of get all of that out of

3:05

the box, this nice responsive player experience, but

3:08

just that one line of code.

3:10

And again, this is a web component.

3:12

So it works with any JavaScript framework

3:14

that you're using to build your application.

3:16

Um, we do also have a Mux player react package,

3:20

which gives you a react component, which has

3:21

the same functionality.

3:23

And also notice here that, um, some other nice features

3:26

is you get the timeline hover previews for your video.

3:29

So as I hover over this video, I can see the little

3:32

thumbnails popping over the timeline, makes it

3:34

really easy for scrubbing.

3:36

And, um, notice this metadata.

3:39

So this metadata video title and viewer ID that

3:41

is actually directly integrated with Mux data.

3:44

So, um, Mux data will monitor the video playback experience,

3:48

quality of experience metrics.

3:49

So you can make sure that your users are having a good

3:51

time viewing your video.

3:53

And that's all wired up by default, passing

3:55

some metadata, makes that data more useful.

3:57

And that's it.

3:58

One line of code, you get all the features of Mux video

4:01

and Mux data integrated.

4:03

In the next video, we'll talk about customizing Mux player.