playerRegistry will handle each player used by the media. It will manage the available players
Methods
# static disposePlayerByMediaId(mediaId, player)
To dispose the player from the media(id)
Parameters:
Name | Type | Description |
---|---|---|
mediaId |
String
|
the mediaId |
player |
interfaces/Player
|
the player |
# static getAvailablePlayer(option) → {interfaces/Player}
To get the available player
Parameters:
Name | Type | Description |
---|---|---|
option |
Object
|
the option |
drm |
media/Media.DRM
|
the drm |
protocol |
media/Media.PROTOCOL
|
the protocol |
the first available player based on the option
# static getAvailablePlayerByMediaId(mediaId, option) → {interfaces/Player}
To get the available player from the media(id)
Parameters:
Name | Type | Description |
---|---|---|
mediaId |
String
|
the mediaId |
option |
Object
|
the option |
drm |
media/Media.DRM
|
the drm |
protocol |
media/Media.PROTOCOL
|
the protocol |
the first available player based on the option
# static getAvailablePlayers(option) → {Array.<interfaces/Player>}
To get the available player
Parameters:
Name | Type | Description |
---|---|---|
option |
Object
|
the option |
drm |
media/Media.DRM
|
the drm |
protocol |
media/Media.PROTOCOL
|
the protocol |
all the available players based on the option
Array.<interfaces/Player>
# static getAvailablePlayersByMediaId(mediaId, option) → {Array.<interfaces/Player>}
To get the available player from the media(id)
Parameters:
Name | Type | Description |
---|---|---|
mediaId |
String
|
the mediaId |
option |
Object
|
the option |
drm |
media/Media.DRM
|
the drm |
protocol |
media/Media.PROTOCOL
|
the protocol |
all the available players based on the option
Array.<interfaces/Player>
# static getPlayersByClass(playerClass) → {Array.<interfaces/Player>}
To get the players instance by the player class
Parameters:
Name | Type | Description |
---|---|---|
playerClass |
interfaces/Player
|
the players instance
Array.<interfaces/Player>
# static register(playerClass, id)
To register from the player registry
Parameters:
Name | Type | Description |
---|---|---|
playerClass |
interfaces/Player
|
|
id |
String
|
the player id |
# static unregister(playerClass)
To unregister from the player registry
Parameters:
Name | Type | Description |
---|---|---|
playerClass |
interfaces/Player
|
# static usePlayerByMediaId(mediaId, player)
To use and link the player from the media(id)
Parameters:
Name | Type | Description |
---|---|---|
mediaId |
String
|
the mediaId |
player |
interfaces/Player
|
the player |