forked from Dash-Industry-Forum/dash.js
-
Notifications
You must be signed in to change notification settings - Fork 0
Feature Overlay events #31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sebastianpiq
wants to merge
27
commits into
development
Choose a base branch
from
feature/overlays
base: development
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
21147c7
[WIP] Add video overlay
jmt-qualabs c791af1
fix styling of overlay video to match video
ronalduQualabs aae54fb
Add iframe overlay
jmt-qualabs b3f25f7
Implement earliestResolutionTime
jmt-qualabs 647c4c4
Change overlay tag
jmt-qualabs f45c568
Remove overlay at end of event duration
jmt-qualabs 962df58
Implement overlay modes and refId
sebastianpiq 35d8d45
Fix seek overlay
sebastianpiq f76b901
Implement overlay event z attribute
sebastianpiq 477d070
Add OverlayController
jmt-qualabs 4f10a07
Fix overlay loop
jmt-qualabs 9280240
Implement overlay size and topleft
sebastianpiq f5f04c3
Implement overlay squeeze content
sebastianpiq 905b24f
Use transitions to manage overlays size
sebastianpiq ed26429
Improve overlay scheduler
sebastianpiq 418c418
Add missing semicolons
sebastianpiq 121cb0a
Remove unused extend mode event id logic
sebastianpiq 734dc38
Add new squeeze current percentage definition
sebastianpiq 1b97763
Add missing semicolons
sebastianpiq 4151332
Improve overlay select mode logic
sebastianpiq 7973882
Implement unit tests
sebastianpiq 2e69c67
Remove unnecessary it only tests
sebastianpiq b4dfd2a
Add missing semicolons and fix wrong let declarations
sebastianpiq cccf004
Fix squeeze current bug
sebastianpiq 29790dd
Add overlay sample page
sebastianpiq 7be71c2
Fix looped overlay
jmt-qualabs 718bb74
Fix overlay controller test
jmt-qualabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or 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,84 @@ | ||
| <!DOCTYPE html> | ||
| <html> | ||
| <head> | ||
| <title>Dash.js Rocks</title> | ||
| <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous"> | ||
| <script src="https://code.jquery.com/jquery-3.4.1.slim.min.js" integrity="sha384-J6qa4849blE2+poT4WnyKhv5vZF5SrPo0iEjwBvKU7imGFAV0wwj1yYfoRSJoZ+n" crossorigin="anonymous"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script> | ||
| <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.4.1/dist/js/bootstrap.min.js" integrity="sha384-wfSDF2E50Y2D1uUdj0O3uMBJnjuUD4Ih7YwaYd1iqfktj0Uod8GCExl3Og8ifwB6" crossorigin="anonymous"></script> | ||
| </head> | ||
| <body> | ||
| <div class="container py-4"> | ||
| <header class="pb-3 mb-4 border-bottom"> | ||
| <img src="./lib/img/dashjs-logo.png" width="200"> | ||
| </header> | ||
|
|
||
| <div class="btn-group mb-2"> | ||
| <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false"> | ||
| Select Case | ||
| </button> | ||
| <div class="dropdown-menu" id="assetDropdown"> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case0.mpd">Case 0: Video</a> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case1.mpd">Case 1: Iframe</a> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case2.mpd">Case 2: Preloading</a> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case3.mpd">Case 3: L shaped</a> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case4.mpd">Case 4: Looped</a> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case5.mpd">Case 5: Logo</a> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case6.mpd">Case 6: Extend</a> | ||
| <a class="dropdown-item" href="#" data-url="https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case8.mpd">Case 7: Out bounds</a> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="dash-video-player"> | ||
| <div class="videoContainer" id="videoContainer"> | ||
| <video id="main-video" preload="auto"></video> | ||
| <div id="overlay"></div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <div class="py-2"> | ||
| <button id="playButton" type="button" class="btn btn-primary">Play/Pause</button> | ||
| </div> | ||
| </div> | ||
|
|
||
| <script src="../../dist/dash.all.debug.js"></script> | ||
| <script> | ||
| (function () { | ||
| const video = document.querySelector("video"); | ||
| const overlay = document.getElementById("overlay"); | ||
| const playButton = document.getElementById("playButton"); | ||
| const assetDropdown = document.getElementById("assetDropdown"); | ||
|
|
||
| const player = dashjs.MediaPlayer().create(); | ||
| player.initialize(); | ||
| player.updateSettings({ | ||
| debug: { | ||
| logLevel: dashjs.Debug.LOG_LEVEL_DEBUG, | ||
| }, | ||
| }); | ||
| player.setAutoPlay(false); | ||
| player.attachView(video); | ||
| player.attachOverlayRenderingDiv(overlay); | ||
|
|
||
| let currentAsset = "https://comcast-dash-6-assets.s3.us-east-2.amazonaws.com/Overlay/case8-b/case0.mpd"; | ||
| player.attachSource(currentAsset); | ||
|
|
||
| playButton.addEventListener("click", () => { | ||
| if (video.paused) { | ||
| video.play(); | ||
| } else { | ||
| video.pause(); | ||
| } | ||
| }); | ||
|
|
||
| assetDropdown.addEventListener("click", (event) => { | ||
| const target = event.target; | ||
| if (target.tagName === "A" && target.dataset.url) { | ||
| currentAsset = target.dataset.url; | ||
| player.attachSource(currentAsset); | ||
| } | ||
| }); | ||
| })(); | ||
| </script> | ||
| </body> | ||
| </html> |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.