File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,12 @@ Group all DRM-related config. The currently available configs are:
8585| ` playback.minimumDvrSizeConfig ` | Returns ` options.playback.minimumDvrSize ` if is configured and is a valid value. | ` {Number} ` |
8686| ` playback.dvrSize ` | Returns ` playback.minimumDvrSizeConfig ` if is a valid value or one default value. (Currently, is 60 seconds) | ` {Number} ` |
8787| ` playback.dvrEnabled ` | Indicates whether the live media is on DVR state. | ` {Boolean} ` |
88+ | ` playback.playbackType ` | Returns if the type of media when this property was not change the value is ` live ` or ` vod ` . | ` {String} ` |
89+ | ` playback.sourceMedia ` | Returns a media url in use. | ` {String} ` |
90+
91+ | setter | description | parameter |
92+ | --------| -------------| ----------|
93+ | ` playback.playbackType ` | Set the new value of playback.playbackType property. | ` {String} ` |
8894
8995## Types
9096#### ` AudioTrack `
Original file line number Diff line number Diff line change @@ -104,9 +104,22 @@ export default class HTML5TVsPlayback extends Playback {
104104 }
105105 }
106106
107+ get playbackType ( ) {
108+ return this . _playbackType
109+ }
110+
111+ set playbackType ( newPlaybackType ) {
112+ this . _playbackType = newPlaybackType
113+ }
114+
115+ get sourceMedia ( ) {
116+ return this . _src
117+ }
118+
107119 constructor ( options , i18n , playerError ) {
108120 super ( options , i18n , playerError )
109121 this . _onAudioTracksUpdated = this . _onAudioTracksUpdated . bind ( this )
122+ this . _playbackType = this . mediaType
110123
111124 this . _drmConfigured = false
112125 this . _isReady = false
Original file line number Diff line number Diff line change @@ -198,6 +198,22 @@ describe('HTML5TVsPlayback', function() {
198198 expect ( this . playback . buffering ) . toEqual ( this . playback . _isBuffering )
199199 } )
200200
201+ test ( 'playbackType getter returns mediaType property when is not changed' , ( ) => {
202+ this . playback . el = { duration : 0 }
203+
204+ expect ( this . playback . playbackType ) . toEqual ( this . playback . mediaType )
205+ } )
206+
207+ test ( 'playbackType setter updates playbackType with new value' , ( ) => {
208+ this . playback . playbackType = 'new value'
209+
210+ expect ( this . playback . playbackType ) . toEqual ( 'new value' )
211+ } )
212+
213+ test ( 'sourceMedia getter returns returns src property' , ( ) => {
214+ expect ( this . playback . sourceMedia ) . toBe ( this . playback . _src )
215+ } )
216+
201217 test ( 'adds event listeners to the audioTrack object of the media element' , ( ) => {
202218 expect ( this . playback . el . audioTracks . addEventListener ) . toHaveBeenCalledWith ( 'addtrack' , this . playback . _onAudioTracksUpdated )
203219 expect ( this . playback . el . audioTracks . addEventListener ) . toHaveBeenCalledWith ( 'removetrack' , this . playback . _onAudioTracksUpdated )
You can’t perform that action at this time.
0 commit comments