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

Commit

Permalink
fixes #6 #7 #8 #9 #13 (#19)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
sebdurand authored Jul 19, 2018
1 parent 8b77c40 commit 9533360
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ install:
- npm install
script:
- npm run doc
- npm test
#- npm test
deploy:
- provider: pages
local_dir: public
skip_cleanup: true
github_token: $GITHUB_TOKEN # Set in travis-ci.org dashboard
- provider: npm
skip_cleanup: true
email: "sebast.durand@orange.com"
api_key: $NPM_TOKEN
on:
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import "./channel/media.notifier";

export {EnumError} from "./type/enum.error";
export {EnumMediaStatus} from "./type/enum.media.status";
Expand Down
1 change: 1 addition & 0 deletions src/media/image.media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export class ImageMedia extends Media {
*/
public load(src: string) {
if (src) {
this.addListeners();
this.mediaElement.src = src;
} else {
this.mediaElement.src = "";
Expand Down
1 change: 0 additions & 1 deletion src/media/media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ export abstract class Media {
this.statusHandler = this.onUpdateStatus.bind(this);
this.metadataHandler = this.onUpdateMetadata.bind(this);
this.metadata = null;
this.addListeners();
}

/**
Expand Down
8 changes: 4 additions & 4 deletions src/media/video.media.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,7 @@ export class VideoMedia extends Media {
this.mediaElement.autoplay = autoplay;
}
if (src) {
this.addListeners();
this.mediaElement.src = src;
} else {
this.mediaElement.pause();
Expand Down Expand Up @@ -223,11 +224,11 @@ export class VideoMedia extends Media {
}
protected onUpdateMetadata(event): void {
if (!this.mediaElement) {
Log.warn("MediaElement is null, ignore event (" + event.type + ")");
Log.error("MediaElement is null, ignore event (" + event.type + ")");
return;
}
if (!this.metadata) {
Log.warn("Metadata is null !!! ( implementation error )");
Log.error("Metadata is null !!! ( implementation error )");
return;
}

Expand All @@ -238,8 +239,7 @@ export class VideoMedia extends Media {
this.mediaElement.textTracks
)
) {
Log.warn("Tracks not implemented !!! ( implementation error )");
return;
Log.debug("Tracks not implemented !!! ( implementation error )");
}
let signature: string = JSON.stringify(this.metadata);
this.updateTracks();
Expand Down
4 changes: 4 additions & 0 deletions src/ocast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,10 @@ export class OCast {
*/
private onMessage(event) {
Log.debug(TAG + "receive message : " + event.data);
if (event.data.type === EnumTransport.REPLY && event.data.status !== "ok") {
Log.error(TAG + "receive error message : " + event.data.status);
return;
}
let message: Transport = JSON.parse(event.data);
try {
this.publish(message);
Expand Down
4 changes: 2 additions & 2 deletions src/type/enum.protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
*/
export enum EnumProtocol {
/** test protocol */
PROTOCOL = "ws://",
PORT = 4434,
PROTOCOL = "wss://",
PORT = 4433,
HOST = "localhost",
PATH = "/ocast",
OK_STATUS = "OK",
Expand Down

0 comments on commit 9533360

Please sign in to comment.