Skip to content

Commit

Permalink
Added asset feature for "AD".
Browse files Browse the repository at this point in the history
Change-Id: I16a90c0b9846c4e90df7be53fecc1aeddd0a22e4
  • Loading branch information
theodab committed Jan 15, 2020
1 parent 4ffcbc6 commit c702ce1
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions demo/asset_card.js
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ shakaDemo.AssetCard = class {
.set(Feature.ULTRA_HIGH_DEFINITION, 'ultra_high_definition')
.set(Feature.SURROUND, 'surround_sound')
.set(Feature.MULTIPLE_LANGUAGES, 'multiple_languages')
.set(Feature.AD, 'ad')
.set(Feature.AUDIO_ONLY, 'audio_only');

for (const feature of asset.features) {
Expand Down
2 changes: 2 additions & 0 deletions demo/common/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@ shakaAssets.Feature = {
OFFLINE: shakaDemo.MessageIds.OFFLINE,
// A synthetic property used in the search tab. Should not be given to assets.
STORED: shakaDemo.MessageIds.STORED,
// Set if the asset has an ad.
AD: shakaDemo.MessageIds.AD,

// Set if the asset is a livestream.
LIVE: shakaDemo.MessageIds.LIVE,
Expand Down
2 changes: 2 additions & 0 deletions demo/common/message_ids.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ shakaDemo.MessageIds = {
AUDIO_ONLY: 'DEMO_AUDIO_ONLY',
OFFLINE: 'DEMO_OFFLINE',
STORED: 'DEMO_STORED',
AD: 'DEMO_AD',
LIVE: 'DEMO_LIVE',
WEBM: 'DEMO_WEBM',
MP4: 'DEMO_MP4',
Expand Down Expand Up @@ -115,6 +116,7 @@ shakaDemo.MessageIds = {
SURROUND_SEARCH: 'DEMO_SURROUND_SEARCH',
OFFLINE_SEARCH: 'DEMO_OFFLINE_SEARCH',
STORED_SEARCH: 'DEMO_STORED_SEARCH',
AD_SEARCH: 'DEMO_AD_SEARCH',
AUDIO_ONLY_SEARCH: 'DEMO_AUDIO_ONLY_SEARCH',
/* Config panel. */
DELAY_LICENSE: 'DEMO_DELAY_LICENSE',
Expand Down
4 changes: 4 additions & 0 deletions demo/demo.less
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,10 @@ html, body {
background-image: data-uri('icons/baseline-language-24px.svg');
}

&[icon="ad"] {
background-image: data-uri('icons/custom_ad.svg');
}

&[icon="audio_only"] {
background-image: data-uri('icons/baseline-audiotrack-24px.svg');
}
Expand Down
1 change: 1 addition & 0 deletions demo/icons/custom_ad.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions demo/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"DEMO_AUDIO_ONLY": "Audio only",
"DEMO_OFFLINE": "Downloadable",
"DEMO_STORED": "Downloaded",
"DEMO_AD": "Ad",
"DEMO_MANIFEST_SEARCH": "Manifest",
"DEMO_CONTAINER_SEARCH": "Container",
"DEMO_DRM_SEARCH": "DRM",
Expand Down Expand Up @@ -97,6 +98,7 @@
"DEMO_SURROUND_SEARCH": "Filters for assets with at least one surround sound audio track.",
"DEMO_OFFLINE_SEARCH": "Filters for assets that can be stored offline.",
"DEMO_STORED_SEARCH": "Filters for assets that have been stored offline.",
"DEMO_AD_SEARCH": "Filters for assets that have advertisements.",
"DEMO_AUDIO_ONLY_SEARCH": "Filters for assets that do not have video streams.",
"DEMO_DELAY_LICENSE": "Delay License Request Until Played",
"DEMO_VIDEO_ROBUSTNESS": "Video Robustness",
Expand Down
8 changes: 8 additions & 0 deletions demo/locales/source.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,10 @@
"message": "Downloaded",
"description": "A tag that marks an asset as being downloaded by the user."
},
"DEMO_AD": {
"message": "Ad",
"description": "A tag that marks an asset as having an advertisement."
},
"DEMO_MANIFEST_SEARCH": {
"message": "Manifest",
"description": "A header on a search field that filters by manifest type."
Expand Down Expand Up @@ -391,6 +395,10 @@
"message": "Filters for assets that have been stored offline.",
"description": "A tooltip for an optional search term."
},
"DEMO_AD_SEARCH": {
"message": "Filters for assets that have advertisements.",
"description": "A tooltip for an optional search term."
},
"DEMO_AUDIO_ONLY_SEARCH": {
"message": "Filters for assets that do not have video streams.",
"description": "A tooltip for an optional search term."
Expand Down
2 changes: 2 additions & 0 deletions demo/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,8 @@ shakaDemo.Search = class {
shakaDemo.MessageIds.OFFLINE_SEARCH);
this.makeBooleanInput_(specialContainer, Feature.STORED, FEATURE,
shakaDemo.MessageIds.STORED_SEARCH);
this.makeBooleanInput_(specialContainer, Feature.AD, FEATURE,
shakaDemo.MessageIds.AD_SEARCH);
this.makeBooleanInput_(specialContainer, Feature.AUDIO_ONLY, FEATURE,
shakaDemo.MessageIds.AUDIO_ONLY_SEARCH);

Expand Down

0 comments on commit c702ce1

Please sign in to comment.