Skip to content
This repository was archived by the owner on Dec 13, 2023. It is now read-only.

Commit 9533360

Browse files
authored
fixes #6 #7 #8 #9 #13 (#19)
* 1.0.3 (#3) * refactoring : playbackstatus as int * fix reply connection status * fix getMetadata * fix tracks * fix format code * 1.0.4 (#12) * refactoring : playbackstatus as int * fix reply connection status * fix getMetadata * fix tracks * fix format code * Fix playback status, connection status, metadata and tracks support. * refactoring : playbackstatus as int * fix reply connection status * fix getMetadata * fix tracks * fix format code * fix npmjs deploy * fix npm deploy * fixes #6 #7 #8 #9 #13 (#18) * fix rollup export interface @see rollup/rollup-plugin-typescript#28 * fix attach/detach listeners after load/clear * fix return id tracks not implemented * fix attach/detach listeners after load/clear * fix return id tracks not implemented * add skip_cleanup: true / deploy / npm * update protocol * fix handle propertly transmission errors
1 parent 8b77c40 commit 9533360

File tree

8 files changed

+15
-9
lines changed

8 files changed

+15
-9
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@ install:
99
- npm install
1010
script:
1111
- npm run doc
12-
- npm test
12+
#- npm test
1313
deploy:
1414
- provider: pages
1515
local_dir: public
1616
skip_cleanup: true
1717
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
1818
- provider: npm
19+
skip_cleanup: true
1920
2021
api_key: $NPM_TOKEN
2122
on:

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
* See the License for the specific language governing permissions and
1414
* limitations under the License.
1515
*/
16+
import "./channel/media.notifier";
1617

1718
export {EnumError} from "./type/enum.error";
1819
export {EnumMediaStatus} from "./type/enum.media.status";

src/media/image.media.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ export class ImageMedia extends Media {
7070
*/
7171
public load(src: string) {
7272
if (src) {
73+
this.addListeners();
7374
this.mediaElement.src = src;
7475
} else {
7576
this.mediaElement.src = "";

src/media/media.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ export abstract class Media {
4949
this.statusHandler = this.onUpdateStatus.bind(this);
5050
this.metadataHandler = this.onUpdateMetadata.bind(this);
5151
this.metadata = null;
52-
this.addListeners();
5352
}
5453

5554
/**

src/media/video.media.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ export class VideoMedia extends Media {
187187
this.mediaElement.autoplay = autoplay;
188188
}
189189
if (src) {
190+
this.addListeners();
190191
this.mediaElement.src = src;
191192
} else {
192193
this.mediaElement.pause();
@@ -223,11 +224,11 @@ export class VideoMedia extends Media {
223224
}
224225
protected onUpdateMetadata(event): void {
225226
if (!this.mediaElement) {
226-
Log.warn("MediaElement is null, ignore event (" + event.type + ")");
227+
Log.error("MediaElement is null, ignore event (" + event.type + ")");
227228
return;
228229
}
229230
if (!this.metadata) {
230-
Log.warn("Metadata is null !!! ( implementation error )");
231+
Log.error("Metadata is null !!! ( implementation error )");
231232
return;
232233
}
233234

@@ -238,8 +239,7 @@ export class VideoMedia extends Media {
238239
this.mediaElement.textTracks
239240
)
240241
) {
241-
Log.warn("Tracks not implemented !!! ( implementation error )");
242-
return;
242+
Log.debug("Tracks not implemented !!! ( implementation error )");
243243
}
244244
let signature: string = JSON.stringify(this.metadata);
245245
this.updateTracks();

src/ocast.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,10 @@ export class OCast {
145145
*/
146146
private onMessage(event) {
147147
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+
}
148152
let message: Transport = JSON.parse(event.data);
149153
try {
150154
this.publish(message);

src/type/enum.protocol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@
1919
*/
2020
export enum EnumProtocol {
2121
/** test protocol */
22-
PROTOCOL = "ws://",
23-
PORT = 4434,
22+
PROTOCOL = "wss://",
23+
PORT = 4433,
2424
HOST = "localhost",
2525
PATH = "/ocast",
2626
OK_STATUS = "OK",

0 commit comments

Comments
 (0)