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

fixes #6 #7 #8 #9 #13 #19

Merged
merged 7 commits into from
Jul 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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