Skip to content

Commit

Permalink
Add label attribute to text track (#831)
Browse files Browse the repository at this point in the history
  • Loading branch information
iKinnrot authored and joeyparrish committed May 31, 2017
1 parent afb0ded commit bed012d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/util/stream_utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,7 @@ shaka.util.StreamUtils.getTextTracks = function(period, activeStreamId) {
active: activeStreamId == stream.id,
type: ContentType.TEXT,
language: stream.language,
label: stream.label,
kind: stream.kind,
mimeType: stream.mimeType,
codecs: stream.codecs || null,
Expand Down
4 changes: 4 additions & 0 deletions test/player_unit.js
Original file line number Diff line number Diff line change
Expand Up @@ -768,10 +768,12 @@ describe('Player', function() {
.addVideo(5).bandwidth(200).size(200, 400).frameRate(24)
.addTextStream(6)
.language('es')
.label('Spanish')
.bandwidth(100).kind('caption')
.mime('text/vtt')
.addTextStream(7)
.language('en')
.label('English')
.bandwidth(100).kind('caption')
.mime('application/ttml+xml')
// Both text tracks should remain, even with different MIME types.
Expand Down Expand Up @@ -876,6 +878,7 @@ describe('Player', function() {
active: true,
type: ContentType.TEXT,
language: 'es',
label: 'Spanish',
kind: 'caption',
mimeType: 'text/vtt',
codecs: null,
Expand All @@ -889,6 +892,7 @@ describe('Player', function() {
active: false,
type: ContentType.TEXT,
language: 'en',
label: 'English',
kind: 'caption',
mimeType: 'application/ttml+xml',
codecs: null,
Expand Down

0 comments on commit bed012d

Please sign in to comment.