File tree 1 file changed +11
-4
lines changed
1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ class HaHLSPlayer extends LitElement {
20
20
21
21
@property ( ) public entityid ?: string ;
22
22
23
+ @property ( ) public url ?: string ;
24
+
23
25
@property ( { attribute : "poster-url" } ) public posterUrl ?: string ;
24
26
25
27
@property ( { type : Boolean , attribute : "controls" } )
@@ -94,14 +96,19 @@ class HaHLSPlayer extends LitElement {
94
96
super . updated ( changedProps ) ;
95
97
96
98
const entityChanged = changedProps . has ( "entityid" ) ;
99
+ const urlChanged = changedProps . has ( "url" ) ;
97
100
98
- if ( ! entityChanged ) {
99
- return ;
101
+ if ( entityChanged ) {
102
+ this . _getStreamUrlFromEntityId ( ) ;
103
+ } else if ( urlChanged && this . url ) {
104
+ this . _cleanUp ( ) ;
105
+ this . _resetError ( ) ;
106
+ this . _url = this . url ;
107
+ this . _startHls ( ) ;
100
108
}
101
- this . _getStreamUrl ( ) ;
102
109
}
103
110
104
- private async _getStreamUrl ( ) : Promise < void > {
111
+ private async _getStreamUrlFromEntityId ( ) : Promise < void > {
105
112
this . _cleanUp ( ) ;
106
113
this . _resetError ( ) ;
107
114
You can’t perform that action at this time.
0 commit comments