This repository was archived by the owner on Dec 13, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 8 files changed +15
-9
lines changed Expand file tree Collapse file tree 8 files changed +15
-9
lines changed Original file line number Diff line number Diff line change @@ -9,13 +9,14 @@ install:
9
9
- npm install
10
10
script :
11
11
- npm run doc
12
- - npm test
12
+ # - npm test
13
13
deploy :
14
14
- provider : pages
15
15
local_dir : public
16
16
skip_cleanup : true
17
17
github_token : $GITHUB_TOKEN # Set in travis-ci.org dashboard
18
18
- provider : npm
19
+ skip_cleanup : true
19
20
20
21
api_key : $NPM_TOKEN
21
22
on :
Original file line number Diff line number Diff line change 13
13
* See the License for the specific language governing permissions and
14
14
* limitations under the License.
15
15
*/
16
+ import "./channel/media.notifier" ;
16
17
17
18
export { EnumError } from "./type/enum.error" ;
18
19
export { EnumMediaStatus } from "./type/enum.media.status" ;
Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ export class ImageMedia extends Media {
70
70
*/
71
71
public load ( src : string ) {
72
72
if ( src ) {
73
+ this . addListeners ( ) ;
73
74
this . mediaElement . src = src ;
74
75
} else {
75
76
this . mediaElement . src = "" ;
Original file line number Diff line number Diff line change @@ -49,7 +49,6 @@ export abstract class Media {
49
49
this . statusHandler = this . onUpdateStatus . bind ( this ) ;
50
50
this . metadataHandler = this . onUpdateMetadata . bind ( this ) ;
51
51
this . metadata = null ;
52
- this . addListeners ( ) ;
53
52
}
54
53
55
54
/**
Original file line number Diff line number Diff line change @@ -187,6 +187,7 @@ export class VideoMedia extends Media {
187
187
this . mediaElement . autoplay = autoplay ;
188
188
}
189
189
if ( src ) {
190
+ this . addListeners ( ) ;
190
191
this . mediaElement . src = src ;
191
192
} else {
192
193
this . mediaElement . pause ( ) ;
@@ -223,11 +224,11 @@ export class VideoMedia extends Media {
223
224
}
224
225
protected onUpdateMetadata ( event ) : void {
225
226
if ( ! this . mediaElement ) {
226
- Log . warn ( "MediaElement is null, ignore event (" + event . type + ")" ) ;
227
+ Log . error ( "MediaElement is null, ignore event (" + event . type + ")" ) ;
227
228
return ;
228
229
}
229
230
if ( ! this . metadata ) {
230
- Log . warn ( "Metadata is null !!! ( implementation error )" ) ;
231
+ Log . error ( "Metadata is null !!! ( implementation error )" ) ;
231
232
return ;
232
233
}
233
234
@@ -238,8 +239,7 @@ export class VideoMedia extends Media {
238
239
this . mediaElement . textTracks
239
240
)
240
241
) {
241
- Log . warn ( "Tracks not implemented !!! ( implementation error )" ) ;
242
- return ;
242
+ Log . debug ( "Tracks not implemented !!! ( implementation error )" ) ;
243
243
}
244
244
let signature : string = JSON . stringify ( this . metadata ) ;
245
245
this . updateTracks ( ) ;
Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ export class OCast {
145
145
*/
146
146
private onMessage ( event ) {
147
147
Log . debug ( TAG + "receive message : " + event . data ) ;
148
+ if ( event . data . type === EnumTransport . REPLY && event . data . status !== "ok" ) {
149
+ Log . error ( TAG + "receive error message : " + event . data . status ) ;
150
+ return ;
151
+ }
148
152
let message : Transport = JSON . parse ( event . data ) ;
149
153
try {
150
154
this . publish ( message ) ;
Original file line number Diff line number Diff line change 19
19
*/
20
20
export enum EnumProtocol {
21
21
/** test protocol */
22
- PROTOCOL = "ws ://" ,
23
- PORT = 4434 ,
22
+ PROTOCOL = "wss ://" ,
23
+ PORT = 4433 ,
24
24
HOST = "localhost" ,
25
25
PATH = "/ocast" ,
26
26
OK_STATUS = "OK" ,
You can’t perform that action at this time.
0 commit comments