diff --git a/.travis.yml b/.travis.yml index f1c93cf..627f90a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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: diff --git a/package-lock.json b/package-lock.json index 9062d2a..0cf2caf 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14246,4 +14246,4 @@ "dev": true } } -} +} \ No newline at end of file diff --git a/package.json b/package.json index 0aaf679..1ea3a37 100644 --- a/package.json +++ b/package.json @@ -75,4 +75,3 @@ "instrument": true } } - diff --git a/src/index.ts b/src/index.ts index 98fa4f0..7b63b46 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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"; diff --git a/src/media/image.media.ts b/src/media/image.media.ts index f499c20..e81efe9 100644 --- a/src/media/image.media.ts +++ b/src/media/image.media.ts @@ -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 = ""; diff --git a/src/media/media.ts b/src/media/media.ts index a9443e7..4976ed5 100644 --- a/src/media/media.ts +++ b/src/media/media.ts @@ -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(); } /** diff --git a/src/media/video.media.ts b/src/media/video.media.ts index c9e9ddf..04e791d 100644 --- a/src/media/video.media.ts +++ b/src/media/video.media.ts @@ -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(); @@ -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; } @@ -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();