Compare commits

...

3 Commits

7 changed files with 22 additions and 14 deletions

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -2,10 +2,12 @@ var errors = require("./errors.js");
var vCarousel = (function () { var vCarousel = (function () {
function vCarousel() { function vCarousel() {
this._vContainers = []; this._vContainers = [];
this._firstVideoId = undefined;
this._playFirstVideo = false; this._playFirstVideo = false;
this._playNextVideos = false; this._playNextVideos = false;
this._noStop = false; this._noStop = false;
this.nbVContainers = 0; this.nbVContainers = 0;
this._currentVideo = undefined;
} }
Object.defineProperty(vCarousel.prototype, "vContainers", { Object.defineProperty(vCarousel.prototype, "vContainers", {
set: function (vContainersIds) { set: function (vContainersIds) {

View File

@ -16,12 +16,12 @@ interface videoDOM
export class vCarousel export class vCarousel
{ {
private _vContainers: videoDOM[] = []; private _vContainers: videoDOM[] = [];
private _firstVideoId: string; private _firstVideoId: string|undefined = undefined;
private _playFirstVideo: boolean = false; private _playFirstVideo: boolean = false;
private _playNextVideos: boolean = false; private _playNextVideos: boolean = false;
private _noStop: boolean = false; private _noStop: boolean = false;
private nbVContainers: number = 0; private nbVContainers: number = 0;
private _currentVideo: HTMLMediaElement; private _currentVideo: HTMLMediaElement|undefined = undefined;
// Les ids reçus doivent correspondre à des éléments HTML contenant une vidéo. // Les ids reçus doivent correspondre à des éléments HTML contenant une vidéo.
set vContainers(vContainersIds: string[]) set vContainers(vContainersIds: string[])
@ -47,13 +47,13 @@ export class vCarousel
} }
// Si this._firstVideoId a été fourni, on vérifie qu'il est présent dans la liste des conteneurs de vidéos. // Si this._firstVideoId a été fourni, on vérifie qu'il est présent dans la liste des conteneurs de vidéos.
set firstVideoId(firstVideo: string) set firstVideoId(firstVideo: string|undefined)
{ {
if((firstVideo!=="" && this._vContainers.findIndex(video => video.id === firstVideo) !== -1) || (firstVideo==="")) if((firstVideo!=="" && this._vContainers.findIndex(video => video.id === firstVideo) !== -1) || (firstVideo===""))
this._firstVideoId=firstVideo; this._firstVideoId=firstVideo;
} }
get firstVideoId() : string get firstVideoId() : string|undefined
{ {
return this._firstVideoId; return this._firstVideoId;
} }
@ -73,7 +73,7 @@ export class vCarousel
this._noStop=noStop; this._noStop=noStop;
} }
get currentVideo() : HTMLMediaElement get currentVideo() : HTMLMediaElement|undefined
{ {
return this._currentVideo; return this._currentVideo;
} }

View File

@ -1,14 +1,16 @@
{ {
"compilerOptions": "compilerOptions":
{ {
"outDir": "./src", "outDir": "./src/build",
"noImplicitAny": true, "module": "ES6",
"module": "es6",
"removeComments": true,
"target": "es5", "target": "es5",
"jsx": "react", "strict":true,
"allowJs": true "removeComments": true,
"allowJs": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true,
}, },
"include": ["src/*.ts"], "include": ["src/*.ts"],
"exclude": ["node_modules", "**/*.spec.ts"] "exclude": ["src/build"]
} }