-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(ui): Add ability to build UI without cast (#4781)
With this, if you build Shaka Player with "-@cast", the UI will contain a dummy cast proxy that does not require the full cast system.
- v4.12.6
- v4.12.6-main
- v4.12.5
- v4.12.5-main
- v4.12.4
- v4.12.4-main
- v4.12.3
- v4.12.3-main
- v4.12.2
- v4.12.2-main
- v4.12.1
- v4.12.1-main
- v4.12.0
- v4.11.18
- v4.11.18-main
- v4.11.17
- v4.11.17-main
- v4.11.16
- v4.11.16-main
- v4.11.15
- v4.11.15-main
- v4.11.14
- v4.11.14-main
- v4.11.13
- v4.11.13-main
- v4.11.12
- v4.11.12-main
- v4.11.11
- v4.11.11-main
- v4.11.10
- v4.11.10-main
- v4.11.9
- v4.11.9-main
- v4.11.8
- v4.11.8-main
- v4.11.7
- v4.11.7-main
- v4.11.6
- v4.11.6-main
- v4.11.5
- v4.11.5-main
- v4.11.4
- v4.11.4-main
- v4.11.3
- v4.11.3-main
- v4.11.2
- v4.11.2-main
- v4.11.1
- v4.11.1-main
- v4.11.0
- v4.10.26
- v4.10.26-main
- v4.10.25
- v4.10.25-main
- v4.10.24
- v4.10.24-main
- v4.10.23
- v4.10.23-main
- v4.10.22
- v4.10.22-main
- v4.10.21
- v4.10.21-main
- v4.10.20
- v4.10.20-main
- v4.10.19
- v4.10.19-main
- v4.10.18
- v4.10.18-main
- v4.10.17
- v4.10.17-main
- v4.10.16
- v4.10.16-main
- v4.10.15
- v4.10.15-main
- v4.10.14
- v4.10.14-main
- v4.10.13
- v4.10.13-main
- v4.10.12
- v4.10.12-main
- v4.10.11
- v4.10.11-main
- v4.10.10
- v4.10.10-main
- v4.10.9
- v4.10.9-main
- v4.10.8
- v4.10.8-main
- v4.10.7
- v4.10.7-main
- v4.10.6
- v4.10.6-main
- v4.10.5
- v4.10.5-main
- v4.10.4
- v4.10.4-main
- v4.10.3
- v4.10.3-main
- v4.10.2
- v4.10.2-main
- v4.10.1
- v4.10.1-main
- v4.10.0
- v4.9.34
- v4.9.34-main
- v4.9.33
- v4.9.33-main
- v4.9.32
- v4.9.32-main
- v4.9.31
- v4.9.31-main
- v4.9.30
- v4.9.30-main
- v4.9.29
- v4.9.29-main
- v4.9.28
- v4.9.28-main
- v4.9.27
- v4.9.27-main
- v4.9.26
- v4.9.26-main
- v4.9.25
- v4.9.25-main
- v4.9.24
- v4.9.24-main
- v4.9.23
- v4.9.23-main
- v4.9.22
- v4.9.22-main
- v4.9.21
- v4.9.21-main
- v4.9.20
- v4.9.20-main
- v4.9.19
- v4.9.19-main
- v4.9.18
- v4.9.18-main
- v4.9.17
- v4.9.17-main
- v4.9.16
- v4.9.16-main
- v4.9.15
- v4.9.15-main
- v4.9.14
- v4.9.14-main
- v4.9.13
- v4.9.13-main
- v4.9.12
- v4.9.12-main
- v4.9.11
- v4.9.11-main
- v4.9.10
- v4.9.10-main
- v4.9.9
- v4.9.9-main
- v4.9.8
- v4.9.8-main
- v4.9.7
- v4.9.7-main
- v4.9.6
- v4.9.6-main
- v4.9.5
- v4.9.5-main
- v4.9.4
- v4.9.4-main
- v4.9.3
- v4.9.3-main
- v4.9.2
- v4.9.2-main
- v4.9.2-caf4
- v4.9.2-caf4-main
- v4.9.2-caf3
- v4.9.2-caf3-main
- v4.9.2-caf2
- v4.9.2-caf2-main
- v4.9.2-caf1
- v4.9.2-caf1-main
- v4.9.1
- v4.9.1-main
- v4.9.0
- v4.8.20
- v4.8.20-main
- v4.8.19
- v4.8.19-main
- v4.8.18
- v4.8.18-main
- v4.8.17
- v4.8.17-main
- v4.8.16
- v4.8.16-main
- v4.8.15
- v4.8.15-main
- v4.8.14
- v4.8.14-main
- v4.8.13
- v4.8.13-main
- v4.8.12
- v4.8.12-main
- v4.8.11
- v4.8.11-main
- v4.8.10
- v4.8.10-main
- v4.8.9
- v4.8.9-main
- v4.8.8
- v4.8.8-main
- v4.8.7
- v4.8.7-main
- v4.8.6
- v4.8.6-main
- v4.8.5
- v4.8.5-main
- v4.8.4
- v4.8.4-main
- v4.8.3
- v4.8.3-main
- v4.8.2
- v4.8.2-main
- v4.8.1
- v4.8.1-main
- v4.8.0
- v4.8.0-main
- v4.7.15
- v4.7.15-main
- v4.7.14
- v4.7.14-main
- v4.7.13
- v4.7.13-main
- v4.7.12
- v4.7.12-main
- v4.7.11
- v4.7.11-main
- v4.7.10
- v4.7.10-main
- v4.7.9
- v4.7.9-main
- v4.7.8
- v4.7.8-main
- v4.7.7
- v4.7.7-main
- v4.7.6
- v4.7.6-main
- v4.7.5
- v4.7.5-main
- v4.7.4
- v4.7.4-main
- v4.7.3
- v4.7.3-main
- v4.7.2
- v4.7.2-main
- v4.7.1
- v4.7.1-main
- v4.7.0
- v4.6.18
- v4.6.18-main
- v4.6.17
- v4.6.17-main
- v4.6.16
- v4.6.16-main
- v4.6.15
- v4.6.15-main
- v4.6.14
- v4.6.14-main
- v4.6.13
- v4.6.13-main
- v4.6.12
- v4.6.12-main
- v4.6.11
- v4.6.11-main
- v4.6.10
- v4.6.10-main
- v4.6.9
- v4.6.9-main
- v4.6.8
- v4.6.8-main
- v4.6.7
- v4.6.7-main
- v4.6.6
- v4.6.6-main
- v4.6.5
- v4.6.5-main
- v4.6.4
- v4.6.4-main
- v4.6.3
- v4.6.3-main
- v4.6.2
- v4.6.2-main
- v4.6.1
- v4.6.1-main
- v4.6.0
- v4.5.0
- v4.4.3
- v4.4.3-main
- v4.4.2
- v4.4.2-main
- v4.4.1
- v4.4.1-main
- v4.4.0
- v4.3.16-main
- v4.3.15-main
- v4.3.14-main
- v4.3.13-main
- v4.3.12-main
- v4.3.11-main
- v4.3.10-main
- v4.3.9-main
- v4.3.8-main
- v4.3.7-main
- v4.3.6-main
- v4.3.5-main
- v4.3.4-main
- v4.3.3-main
- v4.3.2-main
- v4.3.1-main
- v4.2.14-main
- v4.2.13-main
- v4.2.12-main
- v4.2.11-main
- v4.2.10-main
- v4.2.9-main
- v4.2.8-main
- v4.2.7-main
- v4.2.6-main
- v4.2.5-main
- v3.3.19-main
- v3.3.18-main
- v3.3.17-main
- v3.3.16-main
- v3.3.15-main
- v3.3.14-main
- v3.2.21-main
- v3.2.20-main
- v3.2.19-main
- v3.2.18-main
- v3.2.17-main
- v3.2.16-main
Showing
2 changed files
with
131 additions
and
0 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
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,120 @@ | ||
/*! @license | ||
* Shaka Player | ||
* Copyright 2016 Google LLC | ||
* SPDX-License-Identifier: Apache-2.0 | ||
*/ | ||
|
||
goog.provide('shaka.cast.CastProxy'); | ||
|
||
goog.require('shaka.Player'); | ||
goog.require('shaka.util.FakeEventTarget'); | ||
goog.require('shaka.util.IDestroyable'); | ||
|
||
/** | ||
* @summary A dummy version of the cast proxy. Meant to allow Shaka Player to | ||
* build the UI without the cast system. | ||
* | ||
* @implements {shaka.util.IDestroyable} | ||
* @export | ||
*/ | ||
shaka.cast.CastProxy = class extends shaka.util.FakeEventTarget { | ||
/** | ||
* @param {!HTMLMediaElement} video | ||
* @param {!shaka.Player} player | ||
* @param {string} receiverAppId | ||
* @param {boolean} androidReceiverCompatible | ||
*/ | ||
constructor(video, player, receiverAppId, androidReceiverCompatible = false) { | ||
super(); | ||
|
||
/** @private {!HTMLMediaElement} */ | ||
this.video_ = video; | ||
|
||
/** @private {!shaka.Player} */ | ||
this.player_ = player; | ||
} | ||
|
||
/** | ||
* @param {boolean=} forceDisconnect | ||
* @override | ||
* @export | ||
*/ | ||
async destroy(forceDisconnect) { | ||
await this.player_.destroy(); | ||
super.release(); | ||
} | ||
|
||
/** | ||
* @return {!HTMLMediaElement} | ||
* @export | ||
*/ | ||
getVideo() { | ||
return this.video_; | ||
} | ||
|
||
/** | ||
* @return {!shaka.Player} | ||
* @export | ||
*/ | ||
getPlayer() { | ||
return this.player_; | ||
} | ||
|
||
/** | ||
* @return {boolean} | ||
* @export | ||
*/ | ||
canCast() { | ||
return false; | ||
} | ||
|
||
/** | ||
* @return {boolean} | ||
* @export | ||
*/ | ||
isCasting() { | ||
return false; | ||
} | ||
|
||
/** | ||
* @return {string} | ||
* @export | ||
*/ | ||
receiverName() { | ||
return 'dummy'; | ||
} | ||
|
||
/** | ||
* @return {!Promise} | ||
* @export | ||
*/ | ||
async cast() { | ||
await Promise.resolve(); | ||
} | ||
|
||
/** | ||
* @param {Object} appData | ||
* @export | ||
*/ | ||
setAppData(appData) {} | ||
|
||
/** | ||
* @export | ||
*/ | ||
suggestDisconnect() {} | ||
|
||
/** | ||
* @export | ||
*/ | ||
forceDisconnect() {} | ||
|
||
|
||
/** | ||
* @param {string} newAppId | ||
* @param {boolean=} newCastAndroidReceiver | ||
* @export | ||
*/ | ||
async changeReceiverId(newAppId, newCastAndroidReceiver = false) { | ||
await Promise.resolve(); | ||
} | ||
}; |