-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from dolbyio-samples/feedback
Incorporated feedback, making quotation mark usage consistent
- Loading branch information
Showing
2 changed files
with
93 additions
and
84 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,84 +1,90 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> | ||
|
||
<title>Dolby.io Getting Started with Streaming Web SDK</title> | ||
<link rel="shortcut icon" href="https://go.dolby.io/hubfs/Dolby_April2021/images/favicon-32x32.png"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no"> | ||
|
||
<!-- Step 2.1b: Include Millicast Web SDK --> | ||
<script src="https://cdn.jsdelivr.net/npm/@millicast/sdk/dist/millicast.umd.min.js"></script> | ||
<title>Dolby.io Getting Started with Streaming Web SDK</title> | ||
<link rel="shortcut icon" href="https://go.dolby.io/hubfs/Dolby_April2021/images/favicon-32x32.png"> | ||
|
||
<!-- Bootstrap Bundle --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | ||
</head> | ||
<body> | ||
<!-- Step 2.1b: Include Millicast Web SDK --> | ||
<script src="https://cdn.jsdelivr.net/npm/@millicast/sdk/dist/millicast.umd.min.js"></script> | ||
|
||
<div class="container bg-dark text-white gx-4 px-4 py-4 mt-3 rounded"> | ||
<img src="https://go.dolby.io/hubfs/raw_assets/public/Dolby_April2021/images/dolby-io-logo.svg"/> | ||
<h1>Getting Started with Streaming Web SDK</h1> | ||
</div> | ||
<!-- Bootstrap Bundle --> | ||
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" | ||
integrity="sha384-1BmE4kWBq78iYhFldvKuhfTAU6auU8tT94WrHftjDbrCEXSU1oBoqyl2QvZ6jIW3" crossorigin="anonymous"> | ||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/font/bootstrap-icons.css"> | ||
</head> | ||
|
||
<body> | ||
|
||
<div class="container px-4 mt-4"> | ||
<div class="row justify-content-around mt-3"> | ||
<div class="col-8 shadow p-3 mb-5 bg-body rounded text-center"> | ||
<h1>Playback</h1> | ||
<video width="640" height="360" id="streaming-video-placeholder" class="vidBox" controls> | ||
This browser does not support video playback. | ||
</video> | ||
</div> | ||
<div class="container bg-dark text-white gx-4 px-4 py-4 mt-3 rounded"> | ||
<img src="https://go.dolby.io/hubfs/raw_assets/public/Dolby_April2021/images/dolby-io-logo.svg" /> | ||
<h1>Getting Started with Streaming Web SDK</h1> | ||
</div> | ||
|
||
<div class="container px-4 mt-4"> | ||
<div class="row justify-content-around mt-3"> | ||
<div class="col-8 shadow p-3 mb-5 bg-body rounded text-center"> | ||
<h1>Playback</h1> | ||
<video width="640" height="360" id="streaming-video-placeholder" class="vidBox" controls> | ||
This browser does not support video playback. | ||
</video> | ||
</div> | ||
</div> | ||
|
||
<!-- Bootstrap Bundle --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" crossorigin="anonymous"></script> | ||
|
||
|
||
<!-- Dolby.io Starter Application --> | ||
<script type="text/javascript"> | ||
|
||
const main = async () => { | ||
|
||
// Step 2.1c: Set your account id and stream name while Getting Started | ||
const yourStreamAccountId = 'ENTER ACCOUNT ID'; | ||
const yourStreamName = 'ENTER YOUR STREAM NAME'; | ||
|
||
// Callback to generate a subscriber token with credentials | ||
const tokenGenerator = () => millicast.Director.getSubscriber({ | ||
streamName: yourStreamName, | ||
streamAccountId: yourStreamAccountId | ||
}) | ||
|
||
// Step 2.1d: Attach a millicast view to the placeholder node | ||
const videoNode = document.getElementById('streaming-video-placeholder'); | ||
const millicastView = new millicast.View(yourStreamName, tokenGenerator); | ||
millicastView.on("track", (event) => { | ||
console.log("Stream has started."); | ||
videoNode.srcObject = event.streams[0]; | ||
videoNode.hidden = false; | ||
videoNode.autoplay = true; | ||
}); | ||
|
||
// Step 2.1e: Start connection to a publishing stream | ||
try { | ||
const options = { | ||
} | ||
await millicastView.connect(options); | ||
} catch (e) { | ||
if (!millicastView.isActive()) { | ||
console.log("Stream is not live, the broadcast will begin soon."); | ||
} | ||
|
||
console.log("Connection failed: ", e); | ||
millicastView.reconnect(); | ||
</div> | ||
|
||
<!-- Bootstrap Bundle --> | ||
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js" | ||
integrity="sha384-ka7Sk0Gln4gmtz2MlQnikT1wXgYsOg+OMhuP+IlRH9sENBO0LRn5q+8nbTov4+1p" | ||
crossorigin="anonymous"></script> | ||
|
||
|
||
<!-- Dolby.io Starter Application --> | ||
<script type="text/javascript"> | ||
|
||
const main = async () => { | ||
|
||
// Step 2.1c: Set your account id and stream name while Getting Started | ||
const yourStreamAccountId = 'ENTER ACCOUNT ID'; | ||
const yourStreamName = 'ENTER YOUR STREAM NAME'; | ||
|
||
// Callback to generate a subscriber token with credentials | ||
const tokenGenerator = () => millicast.Director.getSubscriber({ | ||
streamName: yourStreamName, | ||
streamAccountId: yourStreamAccountId | ||
}) | ||
|
||
// Step 2.1d: Attach a millicast view to the placeholder node | ||
const videoNode = document.getElementById('streaming-video-placeholder'); | ||
const millicastView = new millicast.View(yourStreamName, tokenGenerator); | ||
millicastView.on('track', (event) => { | ||
console.log('Stream has started.'); | ||
videoNode.srcObject = event.streams[0]; | ||
videoNode.hidden = false; | ||
videoNode.autoplay = true; | ||
}); | ||
|
||
// Step 2.1e: Start connection to a publishing stream | ||
try { | ||
const options = { | ||
} | ||
}; | ||
await millicastView.connect(options); | ||
} catch (e) { | ||
if (!millicastView.isActive()) { | ||
console.log('Stream is not live, the broadcast will begin soon.'); | ||
} | ||
|
||
console.log('Connection failed: ', e); | ||
millicastView.reconnect(); | ||
} | ||
}; | ||
|
||
main(); | ||
|
||
main(); | ||
</script> | ||
|
||
</script> | ||
</body> | ||
|
||
</body> | ||
</html> | ||
</html> |