-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
descriptor type updates v5.0.0 (#4250)
* update to v5 * use descriptorType only for applicable elements (deprecate legacy of values-only usage) * handle viewpoint as read from mpd as array since it's allowed 0..N * adding some info messages for track selection * enhance documentation * cleaning code, adding a warning when defaults are used * add tests on defaulting schemeIdUris * adding sample to exersice track selection * change http to https * rebase: add schemeIdUri for CEA-608 as constant * re-enable CEA-608 parser again (bugfix)
- Loading branch information
Showing
13 changed files
with
532 additions
and
273 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,157 @@ | ||
<!doctype html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<title>Multiple audio tracks sample</title> | ||
<script class="code" src="../../contrib/akamai/controlbar/ControlBar.js"></script> | ||
<script src="../../dist/dash.all.debug.js"></script> | ||
|
||
<!-- Bootstrap core CSS --> | ||
<link href="../lib/bootstrap/bootstrap.min.css" rel="stylesheet"> | ||
<link rel="stylesheet" href="../../contrib/akamai/controlbar/controlbar.css"> | ||
<link href="../lib/main.css" rel="stylesheet"> | ||
|
||
<style> | ||
video { | ||
width: 100%; | ||
} | ||
|
||
.dash-video-player { | ||
position: relative; /* This position relative is needed to position the menus */ | ||
margin: 0 auto; | ||
line-height: 1.0; | ||
} | ||
|
||
#mediaSettings, #selectedTrack { | ||
height:400px; | ||
margin-top: 20px; | ||
font-size: 12px; | ||
} | ||
</style> | ||
|
||
<script class="code"> | ||
function init() { | ||
var url = 'https://webapi.streaming.dolby.com/v0_9/sources/media/v01/dash/lesson_8.mpd'; | ||
var videoElement = document.querySelector('video'); | ||
|
||
var player = dashjs.MediaPlayer().create(); | ||
player.updateSettings({'debug': {'logLevel': dashjs.Debug.LOG_LEVEL_INFO}}); | ||
player.initialize(videoElement, url, true); | ||
player.setInitialMediaSettingsFor('audio', { | ||
lang: 'es', | ||
role: 'alternate', | ||
audioChannelConfiguration: '6', | ||
test: '2', | ||
viewpoint: '1', | ||
accessibility: {schemeIdUri:'urn:mpeg:dash:role:2011', value:'description'} | ||
}) | ||
|
||
var controlbar = new ControlBar(player); | ||
controlbar.initialize(); | ||
|
||
elMediaSetting = document.getElementById('mediaSettings'); | ||
if(elMediaSetting) { | ||
elMediaSetting.innerHTML = JSON.stringify(player.getInitialMediaSettingsFor('audio'), null, 4); | ||
elMediaSetting.scrollTop = elMediaSetting.scrollHeight; | ||
} | ||
|
||
player.on(dashjs.MediaPlayer.events['STREAM_INITIALIZED'], function() { | ||
elTrack = document.getElementById('selectedTrack'); | ||
if(elTrack) { | ||
elTrack.innerHTML = JSON.stringify(player.getCurrentTrackFor('audio'), null, 4); | ||
}; | ||
}); | ||
} | ||
|
||
</script> | ||
</head> | ||
<body> | ||
|
||
<main> | ||
<div class="container py-4"> | ||
<header class="pb-3 mb-4 border-bottom"> | ||
<img class="" | ||
src="../lib/img/dashjs-logo.png" | ||
width="200"> | ||
</header> | ||
<div class="row"> | ||
<div class="col-md-4"> | ||
<div class="h-100 p-5 bg-light border rounded-3"> | ||
<h3>Multi audio - Initial Track</h3> | ||
<p>This example shows how an initial track is selected from content with multiple audio tracks based on preference settings.</p> | ||
<p>Desired media settings are sanitized by a default <code>schemeIdUri</code>, if not provided.</p> | ||
<p>Example requires support for Dolby Audio.</p> | ||
</div> | ||
</div> | ||
<div class="col-md-8"> | ||
<div class="dash-video-player code"> | ||
<div class="videoContainer" id="videoContainer"> | ||
<video preload="auto" autoplay></video> | ||
<div id="videoController" class="video-controller unselectable"> | ||
<div id="playPauseBtn" class="btn-play-pause" title="Play/Pause"> | ||
<span id="iconPlayPause" class="icon-play"></span> | ||
</div> | ||
<span id="videoTime" class="time-display">00:00:00</span> | ||
<div id="fullscreenBtn" class="btn-fullscreen control-icon-layout" title="Fullscreen"> | ||
<span class="icon-fullscreen-enter"></span> | ||
</div> | ||
<div id="bitrateListBtn" class="control-icon-layout" title="Bitrate List"> | ||
<span class="icon-bitrate"></span> | ||
</div> | ||
<input type="range" id="volumebar" class="volumebar" value="1" min="0" max="1" step=".01"/> | ||
<div id="muteBtn" class="btn-mute control-icon-layout" title="Mute"> | ||
<span id="iconMute" class="icon-mute-off"></span> | ||
</div> | ||
<div id="trackSwitchBtn" class="control-icon-layout" title="A/V Tracks"> | ||
<span class="icon-tracks"></span> | ||
</div> | ||
<div id="captionBtn" class="btn-caption control-icon-layout" title="Closed Caption"> | ||
<span class="icon-caption"></span> | ||
</div> | ||
<span id="videoDuration" class="duration-display">00:00:00</span> | ||
<div class="seekContainer"> | ||
<div id="seekbar" class="seekbar seekbar-complete"> | ||
<div id="seekbar-buffer" class="seekbar seekbar-buffer"></div> | ||
<div id="seekbar-play" class="seekbar seekbar-play"></div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div class="row"> | ||
<div class="col-md-6"> | ||
<div class="h-100 p-5 border rounded-3"> | ||
<h3>Get Initial Media Settings For Audio</h3> | ||
<label for="mediaSettings">return value of <code>getInitialMediaSettingsFor('audio')</code>:</label> | ||
<textarea class="form-control" id="mediaSettings"></textarea> | ||
</div> | ||
</div> | ||
<div class="col-md-6"> | ||
<div class="h-100 p-5 border rounded-3"> | ||
<h3>Get selected audio track</h3> | ||
<label for="selectedTrack">return value of <code>getCurrentTrackFor('audio')</code>:</label> | ||
<textarea class="form-control" id="selectedTrack"></textarea> | ||
</div> | ||
</div> | ||
|
||
</div> | ||
<div class="row"> | ||
<div class="col-md-12"> | ||
<div id="code-output"></div> | ||
</div> | ||
</div> | ||
<footer class="pt-3 mt-4 text-muted border-top"> | ||
© DASH-IF | ||
</footer> | ||
</div> | ||
</main> | ||
<script> | ||
document.addEventListener('DOMContentLoaded', function () { | ||
init(); | ||
}); | ||
</script> | ||
<script src="../highlighter.js"></script> | ||
</body> | ||
</html> |
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
Oops, something went wrong.