diff --git a/.vscode/settings.json b/.vscode/settings.json index 5d20645cc..8be439493 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,3 +1,4 @@ { - "javascript.implicitProjectConfig.experimentalDecorators": true + "javascript.implicitProjectConfig.experimentalDecorators": true, + "git.ignoreLimitWarning": true } \ No newline at end of file diff --git a/ng6-seed/package-lock.json b/ng6-seed/package-lock.json index 91fb0fa6a..18695116f 100755 --- a/ng6-seed/package-lock.json +++ b/ng6-seed/package-lock.json @@ -1551,7 +1551,6 @@ "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", - "dev": true, "requires": { "mime-types": "~2.1.24", "negotiator": "0.6.2" @@ -1590,8 +1589,7 @@ "after": { "version": "0.8.2", "resolved": "https://registry.npmjs.org/after/-/after-0.8.2.tgz", - "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=", - "dev": true + "integrity": "sha1-/ts5T58OAqqXaOcCvaI7UF+ufh8=" }, "agent-base": { "version": "4.3.0", @@ -1938,6 +1936,11 @@ "resolved": "https://registry.npmjs.org/async-foreach/-/async-foreach-0.1.3.tgz", "integrity": "sha1-NhIfhFwFeBct5Bmpfb6x0W7DRUI=" }, + "async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==" + }, "asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", @@ -2151,8 +2154,7 @@ "backo2": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", - "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=", - "dev": true + "integrity": "sha1-MasayLEpNjRj41s+u2n038+6eUc=" }, "balanced-match": { "version": "1.0.0", @@ -2217,8 +2219,7 @@ "base64-arraybuffer": { "version": "0.1.5", "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-0.1.5.tgz", - "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=", - "dev": true + "integrity": "sha1-c5JncZI7Whl0etZmqlzUv5xunOg=" }, "base64-js": { "version": "1.3.1", @@ -2249,7 +2250,6 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/better-assert/-/better-assert-1.0.2.tgz", "integrity": "sha1-QIZrnhueC1W0gYlDEeaPr/rrxSI=", - "dev": true, "requires": { "callsite": "1.0.0" } @@ -2642,8 +2642,7 @@ "callsite": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/callsite/-/callsite-1.0.0.tgz", - "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=", - "dev": true + "integrity": "sha1-KAOY5dZkvXQDi28JBRU+borxvCA=" }, "callsites": { "version": "2.0.0", @@ -2975,8 +2974,7 @@ "component-bind": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/component-bind/-/component-bind-1.0.0.tgz", - "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=", - "dev": true + "integrity": "sha1-AMYIq33Nk4l8AAllGx06jh5zu9E=" }, "component-emitter": { "version": "1.3.0", @@ -2987,8 +2985,7 @@ "component-inherit": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/component-inherit/-/component-inherit-0.0.3.tgz", - "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=", - "dev": true + "integrity": "sha1-ZF/ErfWLcrZJ1crmUTVhnbJv8UM=" }, "compressible": { "version": "2.0.18", @@ -6342,11 +6339,25 @@ } } }, + "has-binary2": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", + "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", + "requires": { + "isarray": "2.0.1" + }, + "dependencies": { + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + } + } + }, "has-cors": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/has-cors/-/has-cors-1.1.0.tgz", - "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=", - "dev": true + "integrity": "sha1-XkdHk/fqmEPRu5nCPu9J/xJv/zk=" }, "has-flag": { "version": "3.0.0", @@ -6758,8 +6769,7 @@ "indexof": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/indexof/-/indexof-0.0.1.tgz", - "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=", - "dev": true + "integrity": "sha1-gtwzbSMrkGIXnQWrMpOmYFn9Q10=" }, "inflight": { "version": "1.0.6", @@ -8197,6 +8207,14 @@ "tslib": "^1.9.0" } }, + "mat-video": { + "version": "2.7.2", + "resolved": "https://registry.npmjs.org/mat-video/-/mat-video-2.7.2.tgz", + "integrity": "sha512-rwZt9+gxhyQeUYkWq+7JPwYdMEDMI4iT9mIdhO00TDnihbdv20WHiMZ4yYLudzFnuJIeXzgDrA9yltGWjG3vMw==", + "requires": { + "tslib": "^1.9.0" + } + }, "math-random": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/math-random/-/math-random-1.0.4.tgz", @@ -8552,8 +8570,7 @@ "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", - "dev": true + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==" }, "neo-async": { "version": "2.6.1", @@ -8651,6 +8668,213 @@ } } }, + "ngx-socket-io": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ngx-socket-io/-/ngx-socket-io-3.0.1.tgz", + "integrity": "sha512-6+99AULDEcdrsFSd9FVo5mUSpQMa2KL6twPbteoEv3qWO0Hh2kdrzTjvPdsC2jeTuEuqa8R9l5/3eGYdiLZyWQ==", + "requires": { + "core-js": "^3.0.0", + "reflect-metadata": "^0.1.10", + "socket.io": "^2.2.0", + "socket.io-client": "^2.2.0", + "tslib": "^1.9.0", + "zone.js": "^0.10.1" + }, + "dependencies": { + "arraybuffer.slice": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==" + }, + "base64id": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==" + }, + "blob": { + "version": "0.0.5", + "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", + "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==" + }, + "component-emitter": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", + "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=" + }, + "cookie": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.3.1.tgz", + "integrity": "sha1-5+Ch+e9DtMi6klxcWpboBtFoc7s=" + }, + "core-js": { + "version": "3.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-3.6.5.tgz", + "integrity": "sha512-vZVEEwZoIsI+vPEuoF9Iqf5H7/M3eeQqWlQnYa8FSKKePuYTf5MWnxb5SDAzCa60b3JBRS5g9b+Dq7b1y/RCrA==" + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "requires": { + "ms": "^2.1.1" + } + }, + "engine.io": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.1.tgz", + "integrity": "sha512-8MfIfF1/IIfxuc2gv5K+XlFZczw/BpTvqBdl0E2fBLkYQp4miv4LuDTVtYt4yMyaIFLEr4vtaSgV4mjvll8Crw==", + "requires": { + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "0.3.1", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "ws": "^7.1.2" + } + }, + "engine.io-client": { + "version": "3.4.1", + "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.1.tgz", + "integrity": "sha512-RJNmA+A9Js+8Aoq815xpGAsgWH1VoSYM//2VgIiu9lNOaHFfLpTjH4tOzktBpjIs5lvOfiNY1dwf+NuU6D38Mw==", + "requires": { + "component-emitter": "1.2.1", + "component-inherit": "0.0.3", + "debug": "~4.1.0", + "engine.io-parser": "~2.2.0", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "ws": "~6.1.0", + "xmlhttprequest-ssl": "~1.5.4", + "yeast": "0.1.2" + }, + "dependencies": { + "ws": { + "version": "6.1.4", + "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", + "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", + "requires": { + "async-limiter": "~1.0.0" + } + } + } + }, + "engine.io-parser": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", + "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", + "requires": { + "after": "0.8.2", + "arraybuffer.slice": "~0.0.7", + "base64-arraybuffer": "0.1.5", + "blob": "0.0.5", + "has-binary2": "~1.0.2" + } + }, + "isarray": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-2.0.1.tgz", + "integrity": "sha1-o32U7ZzaLVmGXJ92/llu4fM4dB4=" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "socket.io": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", + "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==", + "requires": { + "debug": "~4.1.0", + "engine.io": "~3.4.0", + "has-binary2": "~1.0.2", + "socket.io-adapter": "~1.1.0", + "socket.io-client": "2.3.0", + "socket.io-parser": "~3.4.0" + } + }, + "socket.io-adapter": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", + "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==" + }, + "socket.io-client": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", + "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", + "requires": { + "backo2": "1.0.2", + "base64-arraybuffer": "0.1.5", + "component-bind": "1.0.0", + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "engine.io-client": "~3.4.0", + "has-binary2": "~1.0.2", + "has-cors": "1.1.0", + "indexof": "0.0.1", + "object-component": "0.0.3", + "parseqs": "0.0.5", + "parseuri": "0.0.5", + "socket.io-parser": "~3.3.0", + "to-array": "0.1.4" + }, + "dependencies": { + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + }, + "socket.io-parser": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", + "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", + "requires": { + "component-emitter": "1.2.1", + "debug": "~3.1.0", + "isarray": "2.0.1" + }, + "dependencies": { + "debug": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", + "requires": { + "ms": "2.0.0" + } + } + } + } + } + }, + "socket.io-parser": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.0.tgz", + "integrity": "sha512-/G/VOI+3DBp0+DJKW4KesGnQkQPFmUCbA/oO2QGT6CWxU7hLGWqU3tyuzeSK/dqcyeHsQg1vTe9jiZI8GU9SCQ==", + "requires": { + "component-emitter": "1.2.1", + "debug": "~4.1.0", + "isarray": "2.0.1" + } + }, + "ws": { + "version": "7.2.5", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.2.5.tgz", + "integrity": "sha512-C34cIU4+DB2vMyAbmEKossWq2ZQDr6QEyuuCzWrM9zfw1sGc0mYiJ0UnG9zzNykt49C2Fi34hvr2vssFQRS6EA==" + }, + "xmlhttprequest-ssl": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/xmlhttprequest-ssl/-/xmlhttprequest-ssl-1.5.5.tgz", + "integrity": "sha1-wodrBhaKrcQOV9l+gRkayPQ5iz4=" + }, + "zone.js": { + "version": "0.10.3", + "resolved": "https://registry.npmjs.org/zone.js/-/zone.js-0.10.3.tgz", + "integrity": "sha512-LXVLVEq0NNOqK/fLJo3d0kfzd4sxwn2/h67/02pjCjfKDxgx1i9QqpvtHD8CrBnSSwMw5+dy11O7FRX5mkO7Cg==" + } + } + }, "ngx-viewer": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/ngx-viewer/-/ngx-viewer-1.0.5.tgz", @@ -9011,8 +9235,7 @@ "object-component": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/object-component/-/object-component-0.0.3.tgz", - "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=", - "dev": true + "integrity": "sha1-8MaapQ78lbhmwYb0AKM3acsvEpE=" }, "object-copy": { "version": "0.1.0", @@ -9522,7 +9745,6 @@ "version": "0.0.5", "resolved": "https://registry.npmjs.org/parseqs/-/parseqs-0.0.5.tgz", "integrity": "sha1-1SCKNzjkZ2bikbouoXNoSSGouJ0=", - "dev": true, "requires": { "better-assert": "~1.0.0" } @@ -9531,7 +9753,6 @@ "version": "0.0.5", "resolved": "https://registry.npmjs.org/parseuri/-/parseuri-0.0.5.tgz", "integrity": "sha1-gCBKUNTbt3m/3G6+J3jZDkvOMgo=", - "dev": true, "requires": { "better-assert": "~1.0.0" } @@ -10253,6 +10474,11 @@ "readable-stream": "^2.0.2" } }, + "recordrtc": { + "version": "5.5.9", + "resolved": "https://registry.npmjs.org/recordrtc/-/recordrtc-5.5.9.tgz", + "integrity": "sha512-6T1tn80nRfsXrAoYWINwz+hBKk+pB5Im4I0BS52Og1ruQvrEdV3IUcm+AKwLMHNyBAhJ2DaVa+9pukTRxMF/uA==" + }, "redent": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-1.0.0.tgz", @@ -10265,8 +10491,7 @@ "reflect-metadata": { "version": "0.1.13", "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", - "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", - "dev": true + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==" }, "regenerate": { "version": "1.4.0", @@ -12071,8 +12296,7 @@ "to-array": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/to-array/-/to-array-0.1.4.tgz", - "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=", - "dev": true + "integrity": "sha1-F+bBH3PdTz10zaek/zI46a2b+JA=" }, "to-arraybuffer": { "version": "1.0.1", @@ -13311,8 +13535,7 @@ "yeast": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz", - "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=", - "dev": true + "integrity": "sha1-AI4G2AlDIMNy28L47XagymyKxBk=" }, "yn": { "version": "2.0.0", diff --git a/ng6-seed/package.json b/ng6-seed/package.json index 2713e1e27..ae9e66556 100755 --- a/ng6-seed/package.json +++ b/ng6-seed/package.json @@ -54,6 +54,7 @@ "karma-jasmine": "^1.1.1", "leaflet": "^1.6.0", "mat-table-exporter": "^1.2.5", + "mat-video": "^2.7.2", "moment": "^2.24.0", "ng-pick-datetime": "^6.0.16", "ng2-charts": "1.6.0", @@ -67,10 +68,12 @@ "ngx-mat-daterange-picker": "^1.1.4", "ngx-mat-select-search": "^1.8.0", "ngx-perfect-scrollbar": "5.0.0-7", + "ngx-socket-io": "^3.0.1", "ngx-viewer": "^1.0.5", "node-sass": "^4.13.0", "perfect-scrollbar": "^1.3.0", "quill": "^1.3.7", + "recordrtc": "^5.5.9", "rxjs": "^6.5.4", "rxjs-compat": "^6.5.4", "screenfull": "^3.2.2", diff --git a/ng6-seed/proxy.conf.json b/ng6-seed/proxy.conf.json new file mode 100644 index 000000000..b9cd9b394 --- /dev/null +++ b/ng6-seed/proxy.conf.json @@ -0,0 +1,7 @@ +{ + "/api/": { + "target": "http://localhost/", + "secure": false, + "changeOrigin": true + } +} \ No newline at end of file diff --git a/ng6-seed/src/app/app.module.ts b/ng6-seed/src/app/app.module.ts index ff95f18ec..02f149121 100755 --- a/ng6-seed/src/app/app.module.ts +++ b/ng6-seed/src/app/app.module.ts @@ -34,7 +34,7 @@ import {MatSelectModule} from '@angular/material/select'; import {MatCardModule} from '@angular/material/card'; import {MatBadgeModule} from '@angular/material/badge'; import {ChangePasswordDialog} from './settings/users/user-profile/user-profile.component'; -import { MatFormFieldModule,MatProgressSpinnerModule } from '@angular/material'; +import { MatFormFieldModule,MatProgressSpinnerModule, MatDialogModule, MatTooltipModule, MatButtonModule } from '@angular/material'; import { AppRoutes } from './app.routing'; import { AppComponent } from './app.component'; import { AdminLayoutComponent } from './layouts/admin/admin-layout.component'; @@ -58,7 +58,12 @@ import { AsyncPipe } from '../../node_modules/@angular/common'; import { PdTrigerService } from './personal-discussion/pd-service/pd-triger.service'; import { HttpLoaderComponent } from './layouts/http-loader/http-loader.component'; import { LoaderService } from './shared/loaderService/loader.service'; - +import {SocketIoConfig, SocketIoModule} from 'ngx-socket-io'; +import { IncomingCallComponent } from './video-chat/incoming-call/incoming-call.component'; +import { VideoChatComponent } from './video-chat/video-chat.component' +import { PushNotifyService } from './shared/push-notify.service'; +import { MatVideoModule } from 'mat-video'; +import { VideoPlayerComponent } from './video-chat/video-player/video-player.component'; export function HttpLoaderFactory(http: HttpClient) { return new TranslateHttpLoader(http); @@ -72,14 +77,17 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { suppressScrollX: true }; +const socketConfig: SocketIoConfig = { url: environment.socketServerUrl, options: {} }; + @NgModule({ declarations: [ AppComponent, AdminLayoutComponent, AuthLayoutComponent, - NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent + NewPasswordDialog,ForgotPass,ChangePasswordDialog, RoleMenuItemsPipe, HttpLoaderComponent, IncomingCallComponent, VideoChatComponent, VideoPlayerComponent ], imports: [ + MatDialogModule, BrowserModule, BrowserAnimationsModule, SharedModule, @@ -89,12 +97,15 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { MatSidenavModule, MatInputModule, MatIconModule, + MatButtonModule, MatListModule, MatMenuModule, MatToolbarModule, MatTabsModule, MatCheckboxModule, MatProgressBarModule,MatProgressSpinnerModule, + MatTooltipModule, + MatSelectModule, MatCardModule, MatBadgeModule, @@ -114,6 +125,8 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { AngularFireAuthModule, AngularFireMessagingModule, AngularFireModule.initializeApp(environment.firebase), + SocketIoModule.forRoot(socketConfig), + MatVideoModule ], providers: [ { @@ -123,6 +136,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { AwsService,AuthGuard, TranslateService, PdTrigerService, + PushNotifyService, // { // provide: PERFECT_SCROLLBAR_CONFIG, // useValue: DEFAULT_PERFECT_SCROLLBAR_CONFIG @@ -134,7 +148,7 @@ const DEFAULT_PERFECT_SCROLLBAR_CONFIG: PerfectScrollbarConfigInterface = { }, MessagingService, AsyncPipe,LoaderService ], - entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog], + entryComponents: [NewPasswordDialog,ForgotPass,ChangePasswordDialog,IncomingCallComponent,VideoChatComponent,VideoPlayerComponent], bootstrap: [AppComponent] }) export class AppModule { } diff --git a/ng6-seed/src/app/dashboard/dashboard.component.html b/ng6-seed/src/app/dashboard/dashboard.component.html index af0cc1fe0..35cfbad9a 100755 --- a/ng6-seed/src/app/dashboard/dashboard.component.html +++ b/ng6-seed/src/app/dashboard/dashboard.component.html @@ -1,3 +1,4 @@ +
diff --git a/ng6-seed/src/app/dashboard/dashboard.component.ts b/ng6-seed/src/app/dashboard/dashboard.component.ts index 65ea7a4b2..654e22656 100755 --- a/ng6-seed/src/app/dashboard/dashboard.component.ts +++ b/ng6-seed/src/app/dashboard/dashboard.component.ts @@ -6,7 +6,8 @@ import { MastersService } from '../settings/service/masters/masters.service'; import { DashboardService } from './dashboard.service'; import { NgxDrpOptions, PresetItem, Range } from 'ngx-mat-daterange-picker'; import { BaseChartDirective } from 'ng2-charts/ng2-charts'; - +import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component'; +import { MatDialog } from '@angular/material'; @Component({ selector: 'app-dashboard', templateUrl: './dashboard.component.html', @@ -40,7 +41,7 @@ export class DashboardComponent { // }]; - constructor(private _dashboardService: DashboardService) {} + constructor(private _dashboardService: DashboardService,private dialog:MatDialog) {} ngOnInit(){ @@ -360,5 +361,4 @@ getDoughnutChartData(){ }) } - } \ No newline at end of file diff --git a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts index 6c06c0086..77b75f14e 100755 --- a/ng6-seed/src/app/layouts/admin/admin-layout.component.ts +++ b/ng6-seed/src/app/layouts/admin/admin-layout.component.ts @@ -15,6 +15,11 @@ import { AwsService } from '../../AwsService/aws.service'; import { RoleMenuItemsPipe } from './../role-menu-items.pipe'; import 'rxjs/add/observable/interval'; import { MessagingService } from 'app/shared/messaging.service'; +import { IncomingCallComponent } from '../../video-chat/incoming-call/incoming-call.component'; +import { Socket } from 'ngx-socket-io'; +import { MatDialog } from '@angular/material'; +import { VideoChatComponent } from 'app/video-chat/video-chat.component'; +import { PushNotifyService } from 'app/shared/push-notify.service'; @@ -59,8 +64,9 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { permissionDeined : boolean = true; alertTAT: any; countTAT: number; - - constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService,private messagingService:MessagingService) { + incomingDialogOpened:boolean = false + constructor(private router: Router, public menuItems: MenuItems, public horizontalMenuItems : HorizontalMenuItems, public translate: TranslateService,public aws:AwsService,public users:UserService,private _dashboardService: DashboardService,private messagingService:MessagingService,private socket:Socket,private matDialog:MatDialog, + private _notificationService:PushNotifyService) { const browserLang: string = translate.getBrowserLang(); translate.use(browserLang.match(/en|fr/) ? browserLang : 'en'); @@ -112,6 +118,8 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { }); // this.alertForTAT(); + this._notificationService.requestPermission(); + console.log("constructor called") } ngOnInit(): void { @@ -138,7 +146,14 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { // Ps.update(elemContent); } }); - + setTimeout(()=>{ + this.listenForCalls() + },5000) + // this.openIncomingDialog(); + console.log("Ng On Init") + } + ngAfterViewInit() { + console.log("Ng After view init") } @HostListener('click', ['$event']) @@ -293,6 +308,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { this.aws.logout().subscribe(res=>{ //alert("res"); localStorage.removeItem('user_role'); + localStorage.removeItem('pd_short_info'); this.messagingService.unsubscribeNotification() setTimeout(()=>{ this.router.navigate(['/authentication/login']); @@ -311,4 +327,75 @@ export class AdminLayoutComponent implements OnInit, OnDestroy { break; } } + // FOR LISTENING TO RECIEVE CALLS FROM CALLER + listenForCalls() { + // this.socket.on('BackOffer', this.connectPeer) + let userrole = localStorage.getItem('user_role') + if(userrole == '5') { + this.socket.fromEvent('BackOffer').subscribe((res:any)=>{ + let pd_short_info:any = localStorage.getItem('pd_short_info') + pd_short_info = JSON.parse(pd_short_info); + console.log(res) + if(res && res.hasOwnProperty('random_string') && res.random_string && res.hasOwnProperty('user_type') && res.user_type != 'officer'){ + if(pd_short_info.filter(val=>val.random_string == res.random_string).length > 0){ + let curr_pd_info= pd_short_info.filter(val=>val.random_string == res.random_string)[0] + if(curr_pd_info && curr_pd_info.pd_type == '3') { + this.connectPeer(res,curr_pd_info); + } + } + } + }) + } + } + connectPeer(offer,curr_pd_info) { + console.log(offer) + // alert("Offer is listened"); + this.notify('Incoming Call','Calling from ' + curr_pd_info.applicant_name + ' (' +curr_pd_info.pd_sno+ ')') + this.openIncomingDialog(offer,curr_pd_info); + } + openIncomingDialog(offer?,curr_pd_info?) { + offer.pd_id = curr_pd_info.pd_id + if(this.incomingDialogOpened == true) { + return; + } + this.incomingDialogOpened = true + const dialogRef = this.matDialog.open(IncomingCallComponent,{ + // minWidth:'25%', + // maxWidth:'30%', + data:curr_pd_info, + disableClose: true, + backdropClass: 'incoming-call-background' , + panelClass:'incoming-call-background' + }) + dialogRef.afterClosed().subscribe(data=>{ + console.log(data) + if(data == 'decline'){ + this.incomingDialogOpened = false + this.socket.emit('callStatus',{random_string:curr_pd_info.random_string,status:'declined',status_code:3}) + } + else { + this.incomingDialogOpened = false + this.openVideoChatDialog(offer) + } + }) + } + openVideoChatDialog(offer) { + let dialogRef = this.matDialog.open(VideoChatComponent,{ + data:offer, + maxWidth: '100vw', + maxHeight: '100vh', + height: '100%', + width: '100%', + disableClose: true, + panelClass:'video-chat' + }) + } + notify(title,approval) { + let data: Array < any >= []; + data.push({ + 'title': title, + 'body': approval + }); + this._notificationService.generateNotificationWithTitle(data); +} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html index b458693ba..47a54f55b 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html @@ -26,5 +26,7 @@ +    \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts index fd872a492..f4f9bdb63 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts @@ -21,6 +21,8 @@ export class PdStatusChangeDialogueComponent implements OnInit { addonStatus: string ="ADD_ON_PENDING"; public Loading: boolean; public masterRandomString : string; + fk_pd_type: any; + pd_completeness_override: String = '0'; constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) { @@ -31,6 +33,8 @@ export class PdStatusChangeDialogueComponent implements OnInit { this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true; this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false; this.masterRandomString = this.data.random_string; + this.fk_pd_type = this.data.pd_type + console.log("sdf@@@@@@@@@@2",this.fk_pd_type) } ngOnInit() { @@ -60,9 +64,10 @@ export class PdStatusChangeDialogueComponent implements OnInit { } changePDStatus(status: string): void { - let update_status = { + let update_status:any = { "pd_id":this.data.pdid, }; + update_status.pd_completeness_override = this.pd_completeness_override this.pd.editPdMasterDetails(update_status, status,this.masterRandomString).subscribe(result => { if (result.status == 200) { this.dialogRef.close({update_status:true}); @@ -77,5 +82,17 @@ export class PdStatusChangeDialogueComponent implements OnInit { this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); }); } - + overwritten_pd() { + // this.changePDStatus(this.data.pd_status,'1'); + let params: any={}; + params.pd_id = this.data.pdid; + this.CompletenessCheck = true; + this.pd_completeness_override = '1' + // this.Loading = false; + this.pd.getPDCompleteDetails(params).subscribe(result => { + if (result.dataStatus === true) { + this.enableAddonPD = result.records.address_count>0 ? true: false; + } + }); + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts index 34241ac0c..458c8c366 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.ts @@ -1210,8 +1210,10 @@ export class BusinessAssetsInfoComponent implements OnInit { if (flag == 1) { if (value == 'yes') { item.controls.business_years.setValidators([Validators.required]); + if(this.fk_pd_type != '3') { item.controls.business_is_pd_visited.setValidators([Validators.required]); item.controls.business_pd_visited_remark.setValidators([Validators.required]); + } item.controls.business_ownership_type.setValidators([Validators.required]); } else { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html index 6cd7b0cb3..4e1608952 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.html @@ -41,7 +41,7 @@ Service Provided Required - + @@ -156,7 +156,7 @@ Specify the Mode of Transport Used to Visit the PD address Required - + CLIX MWISE diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts index 70e310680..15bb49fa4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/final-remarks/final-remarks.component.ts @@ -256,7 +256,7 @@ export class FinalRemarksComponent implements OnInit { this._finalRemarkForm.controls.market_intelligence.setValue(data.records.market_intelligence || ''); - if(this.lender_short_name == 'CLIX' || this.lender_short_name == 'MWISE' || this.prod_catagory == 'LAEP'){ + if(this.fk_pd_type != '3' && (this.lender_short_name == 'CLIX' || this.lender_short_name == 'MWISE' || this.prod_catagory == 'LAEP')){ if(this.prod_catagory == 'LAEP') {this._finalRemarkForm.controls.outlet_location.setValue(this.prod_catagory == 'LAEP' ? data.records.outlet_location : ''); } this._finalRemarkForm.controls.is_competition.setValue(data.records.is_competition); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index b1f6d4669..6b2f3cfd6 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -500,7 +500,7 @@

Photograph of Kuchha bills allowed
- Photographs of kuccha bills uploded
+ Photographs of kuccha bills uploaded
Yes    diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index 0d5fb42a5..e738c9cb1 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -37,14 +37,16 @@ - Is Person Met + Person Contacted + Is Person Met - Is Applicant + Is Loan applicant + Is Applicant diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss index 420e13e5e..4d5f3892e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.scss @@ -44,7 +44,10 @@ display:flex; justify-content:flex-end; } - + mat-cell:nth-child(1), + mat-header-cell:nth-child(1) { + flex: 0 0 20%; + } mat-cell:nth-child(5), mat-header-cell:nth-child(5) { flex: 0 0 17%; @@ -52,12 +55,21 @@ mat-cell:nth-child(6), mat-header-cell:nth-child(6) { - flex: 0 0 20%; + flex: 0 0 15%; + } + + mat-cell:nth-child(3), + mat-header-cell:nth-child(3), + mat-cell:nth-child(2), + mat-header-cell:nth-child(2) { + margin-left: 1%; + margin-right: 1%; } mat-cell:nth-child(7), mat-header-cell:nth-child(7) { justify-content: end; + flex: 0 0 19%; } .capitalize{ @@ -172,4 +184,7 @@ $product-bg-color-hover: rgba(103, 58, 183, 0.7); // } } } + // .mat-column-is_applicant { + // width: 12%; + // } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts index d0585f518..de4ae1354 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts @@ -9,8 +9,8 @@ import { MatDialog, MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; /** Service */ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service'; import { ActivatedRoute, Router } from '@angular/router'; -import { analyzeAndValidateNgModules } from '@angular/compiler'; -import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; +// import { analyzeAndValidateNgModules } from '@angular/compiler'; +// import { ImageCropComponent } from '../dialogue/image-crop/image-crop.component'; @Component({ // changeDetection: ChangeDetectionStrategy.OnPush, @@ -90,6 +90,8 @@ export class StockComponent implements OnInit { this.fk_pd_type = this.pd_all_details.pdmaster_details.fk_pd_type; if(this.fk_pd_type == '3'){ this.SPsufficientList.push({value:"not able to assess",isdisplayvalue:"Not able to assess",isdisabled:false}) + this.TGsufficientList.push({value:"not able to assess",isdisplayvalue:"Not able to assess",isdisabled:false}) + this.RMsufficientList.push({value:"not able to assess",isdisplayvalue:"Not able to assess",isdisabled:false}) } this.image_doc_params={pdid:this.pdid,form_id:this.form_id,company_id:this.company_id} } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts index 1b2771c14..4cde14ecb 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts @@ -140,7 +140,7 @@ export class StartPdComponent implements OnInit, OnDestroy { // load pd status change dialogue pdStatusDialogue(status: string, checkType: number): void { const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { - data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString }, + data: { pdid: this.startPD, pd_status: status ,random_string:this.randomString,pd_type:this.pdMasterList.fk_pd_type }, disableClose: true, minWidth:'30%', maxWidth:'40%', diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.animations.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.animations.ts new file mode 100644 index 000000000..6c84239e9 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.animations.ts @@ -0,0 +1,52 @@ +import { + animate, + keyframes, + query, + stagger, + state, + style, + transition, + trigger + } from '@angular/animations'; + + export const speedDialFabAnimations = [ + trigger('fabToggler', [ + state('inactive', style({ + transform: 'rotate(0deg)' + })), + state('active', style({ + transform: 'rotate(225deg)' + })), + transition('* <=> *', animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)')), + ]), + trigger('speedDialStagger', [ + transition('* => *', [ + + query(':enter', style({ opacity: 0 }), {optional: true}), + + query(':enter', stagger('40ms', + [ + animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)', + keyframes( + [ + style({opacity: 0, transform: 'translateY(10px)'}), + style({opacity: 1, transform: 'translateY(0)'}), + ] + ) + ) + ] + ), {optional: true}), + + query(':leave', + animate('200ms cubic-bezier(0.4, 0.0, 0.2, 1)', + keyframes([ + style({opacity: 1}), + style({opacity: 0}), + ]) + ), {optional: true} + ) + + ]) + ]) + ]; + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.html new file mode 100644 index 000000000..13faaab76 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.html @@ -0,0 +1,26 @@ +
+
+ +
+ +
+ +
+
+ \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.scss new file mode 100644 index 000000000..729e995bb --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.scss @@ -0,0 +1,50 @@ +.fab-container { + position: absolute; + // top: 1%; + // right: 35%; + z-index: 100; + display: flex; + flex-direction: column; + align-items: center; + + > div { + display: flex; + flex-direction: row; + align-items: center; + // margin-top: 5px; + // margin-top: 5px; + position: absolute; + right: 67px; + // top: -13px; + + button { + // margin-top: 17px; + background: #cfdd49; + margin-left:10px; + } + } + } + @media(max-width:580px) { + .fab-container { + > div { + flex-direction: column !important; + right: 0px; + top: 53px; + } + } + } + + .fab-toggler { + float: right; + z-index: 100; + } + + #fab-dismiss { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + z-index: 99; + } + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.spec.ts new file mode 100644 index 000000000..323c57739 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { SpeedDialFabComponent } from './speed-dial-fab.component'; + +describe('SpeedDialFabComponent', () => { + let component: SpeedDialFabComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ SpeedDialFabComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(SpeedDialFabComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.ts new file mode 100644 index 000000000..b478e8ab0 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/speed-dial-fab/speed-dial-fab.component.ts @@ -0,0 +1,42 @@ +import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core'; +import { speedDialFabAnimations } from './speed-dial-fab.animations'; + +@Component({ + selector: 'app-speed-dial-fab', + templateUrl: './speed-dial-fab.component.html', + styleUrls: ['./speed-dial-fab.component.scss'], + animations: speedDialFabAnimations +}) +export class SpeedDialFabComponent implements OnInit { + + @Input() options; + @Output() fabClick = new EventEmitter() + buttons = []; + fabTogglerState = 'inactive'; + + constructor() { } + + ngOnInit() { + const maxButtons = 6; + if (this.options.buttons.length > maxButtons) { + this.options.buttons.splice(5, this.options.buttons.length - maxButtons); + } + } + + showItems() { + this.fabTogglerState = 'active'; + this.buttons = this.options.buttons; + } + + hideItems() { + this.fabTogglerState = 'inactive'; + this.buttons = []; + } + + onToggleFab() { + this.buttons.length ? this.hideItems() : this.showItems(); + } + onBtnClick(btnValue) { + this.fabClick.emit(btnValue) + } +} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index 64c1ed28c..5fbe85637 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -125,22 +125,38 @@
-
-
- - +    + + + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss index c5c7841fb..690abec80 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.scss @@ -79,3 +79,11 @@ // } +.fab-group{ + // app-speed-dial-fab { + position: absolute; + @media(min-width:500px) { + // right: 415px; + } + // } +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index fa4b152d9..a70553a1b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -19,6 +19,9 @@ import { InitiateAdditionalPdComponent } from './../initiate-additional-pd/initi /**sweet alert */ import Swal from 'sweetalert2'; +import { VideoChatComponent } from 'app/video-chat/video-chat.component'; +import { MastersComponent } from 'app/settings/masters/masters.component'; +import { VideoPlayerComponent } from 'app/video-chat/video-player/video-player.component'; @Component({ selector: 'app-view-pd', @@ -100,6 +103,32 @@ export class ViewPdComponent implements OnInit, OnDestroy { public _EditPDtriggerForm: FormGroup; existPDs: any=[]; // no_qc_remarks: boolean; + + FabOptions = { + buttons: [ + { + icon: 'camera', + placeholder:'Image Capture', + btnValue:'image' + }, + { + icon: 'videocam', + placeholder:'Video Chat', + btnValue:'video' + }, + // { + // icon: 'room' + // }, + // { + // icon: 'lightbulb_outline' + // }, + // { + // icon: 'lock' + // } + ] + }; + videoSrc: any = null; + constructor(notifier: NotifierService, private dialog: MatDialog, private _fb: FormBuilder, private _pd: PdTrigerService, private route: ActivatedRoute, private router: Router, private ListPdComponent: ListPdComponent) { this.notifier = notifier; @@ -118,7 +147,7 @@ export class ViewPdComponent implements OnInit, OnDestroy { // this.masterRandomString = this.route.snapshot.params['rdmstr']; this.viewPdDetails(this.viewID,this.masterRandomString); this.getAllNotes(); - + this.getVideoUrl(this.viewID,this.masterRandomString) } pd_QC_Rating: Number; @@ -559,12 +588,21 @@ export class ViewPdComponent implements OnInit, OnDestroy { }) } - copyCusURL(randomStr) { + copyCusURL(event) { // console.log(window.location); - let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr; - console.log(randomStr) + console.log(event) + let cus_link; + if(event && event.btnValue == 'video') { + cus_link = window.location.origin+'/vchat/#/chat/'+this.pdMasterData[0].random_string; + } + else if(event && event.btnValue == 'image') { + cus_link = window.location.origin+'/customer/#/pd-images/'+this.pdMasterData[0].random_string; + } + // return; + // let cus_link = window.location.origin+'/customer/#/pd-images/'+randomStr; + // console.log(randomStr) this._pd.copyToClipBoard(cus_link); - this.notifier.notify('info','Customer link copied'); + this.notifier.notify('info',event.placeholder+' Customer link copied'); } onClickSmsLink(master){ @@ -581,4 +619,37 @@ export class ViewPdComponent implements OnInit, OnDestroy { }) } + openVideoChat(){ + let dialogRef = this.dialog.open(VideoChatComponent,{ + data:{type:'init',random_string:this.pdMasterData[0].random_string}, + maxWidth: '100vw', + maxHeight: '100vh', + height: '100%', + width: '100%', + disableClose: true, + panelClass:'video-chat' + }) + } + openPlayer(){ + if(this.videoSrc == null) { + this.notifier.notify('info',"No Videos Found"); + return; + } + let dialogRef = this.dialog.open(VideoPlayerComponent,{ + data:{videoUrl:this.videoSrc}, + maxWidth: '100vw', + maxHeight: '100vh', + height: '80%', + width: '80%', + disableClose: false, + panelClass:'video-player' + }) +} +getVideoUrl(pd_id,randomStr){ + let params = {"pd_id":pd_id,"random_string":randomStr} + this._pd.getRecordedPlaybackUrl(params).subscribe(result=>{ + this.videoSrc=result['url']; + }) +} + } \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts index ebeacc411..049e4cfad 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts @@ -129,6 +129,7 @@ import {AngularSplitModule} from 'angular-split'; import { ImageDocsComponent } from './list-pd/start-pd/forms/image-docs/image-docs.component' import { environment } from 'environments/environment' import { CustomTitleCaseDirective } from '../pd-directive/custom-title-case.directive'; +import { SpeedDialFabComponent } from './list-pd/view-pd/speed-dial-fab/speed-dial-fab.component'; /** * Custom angular notifier options @@ -175,7 +176,7 @@ const pdCustomNotifierOptions: NotifierOptions = { }; @NgModule({ - declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective], + declarations: [TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent,PdCollectedDocsComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent, SearchRelationPipe, RupeeCurrencyFormatPipe, NumberToWordsPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent, GetAnswerableFormsPipe, ConfirmAiDetailsComponent, RentalVerificationComponent, InitiateAdditionalPdComponent ,ManageDailyPurchaseComponent, DailyPurchaseDetailsComponent, ManageRentalVerificationComponent, FuturePlansAndBusinessEnvironmentComponent, ImageCropComponent,PurchaseCalculationComponent,QueriesDocsComponent, ImageDocsComponent,CustomTitleCaseDirective, SpeedDialFabComponent], imports: [ CommonModule, ManagePdRoutingModule, diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts index ce3b5012c..8966516cc 100755 --- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts @@ -1,7 +1,7 @@ /** Common Import Section */ import { Injectable } from '@angular/core'; import { Observable, of, forkJoin } from 'rxjs'; -import { HttpClient, HttpParams } from '@angular/common/http'; +import { HttpClient, HttpParams, HttpHeaders } from '@angular/common/http'; import { catchError, map } from 'rxjs/operators'; /** Imported Service Files Are., */ @@ -184,7 +184,20 @@ export class PdTrigerService { // get pd details getPdDetails(): Observable { - return this._http.get(this.apiUrl + "listLessPDDetails/get") + let userrole = localStorage.getItem('user_role') + let params + if(userrole == '5') { + let userid = this._aws.getlocale() + params = new HttpParams().set("pdofficerid",userid); //Create new HttpParams + } + return this._http.get(this.apiUrl + "listLessPDDetails/get", {params: params}) + .map(res=>{ + if(res['dataStatus']) { + let pd_det = res['records'].map(val=>{ return {applicant_name:val.applicant_name,pd_id:val.pd_id,random_string:val.random_string,pd_sno:val.pd_sno,pd_type:val.fk_pd_type}}) + localStorage.setItem('pd_short_info',JSON.stringify(pd_det)); + return res + } + }) .pipe( catchError(this.handleError('operation', [])) ) @@ -192,9 +205,25 @@ export class PdTrigerService { // get status based pd list getTabStatusPdDetails(status: string): Observable { - const tabStatus = status ? + let userrole = localStorage.getItem('user_role') + let tabStatus + if(userrole == '5') { + let userid = this._aws.getlocale() + tabStatus = new HttpParams().set("pdofficerid",userid).set('status', status); //Create new HttpParams + tabStatus = { params: new HttpParams().set("pdofficerid",userid).set('status', status) }; + } + else { + tabStatus = status ? { params: new HttpParams().set('status', status) } : {}; + } return this._http.get(this.apiUrl + "listLessPDDetails/get", tabStatus) + // .map(res=>{ + // if(res['dataStatus']) { + // let pd_det = res['records'].map(val=>{ return {applicant_name:val.applicant_name,pd_id:val.pd_id,random_string:val.random_string,pd_sno:val.pd_sno,pd_type:val.fk_pd_type}}) + // localStorage.setItem('pd_short_info',JSON.stringify(pd_det)); + // return res + // } + // }) .pipe( catchError(this.handleError('operation', [])) ) @@ -683,8 +712,21 @@ export class PdTrigerService { */ overAllSearchFormDetails(searchItem) { + let userrole = localStorage.getItem('user_role') + if(userrole == '5') { + let userid = this._aws.getlocale() + searchItem.pd_officer_id = userid + } let records = { 'records': searchItem }; - return this._http.post(this.apiUrl + 'filterPDList', records).pipe( + return this._http.post(this.apiUrl + 'filterPDList', records) + .map(res=>{ + if(res['dataStatus']) { + let pd_det = res['records'].map(val=>{ return {applicant_name:val.applicant_name,pd_id:val.pd_id,random_string:val.random_string,pd_sno:val.pd_sno,pd_type:val.fk_pd_type}}) + localStorage.setItem('pd_short_info',JSON.stringify(pd_det)); + return res + } + }) + .pipe( catchError(this.handleError('operation', [])) ); } @@ -847,4 +889,20 @@ export class PdTrigerService { document.execCommand('copy'); document.body.removeChild(selBox); } + // saveVideo(params) { + // const httpOptions = { + // headers: new HttpHeaders({ + // 'Content-Type': 'application/json', + // 'Access-Control-Allow-Origin': '*', + // 'Access-Control-Allow-Credentials': 'true' + // }) + // }; + // return this._http.post('http://localhost/newCode/saveVideo',params,httpOptions); + // } + saveCusVideo(params) { + return this._http.post(this.apiUrl+'saveCusVideo',params); + } + getRecordedPlaybackUrl(params){ + return this._http.post(this.apiUrl+'getVideoURL',params) + } } diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts index 0fd9ffcee..b54572021 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.ts @@ -193,7 +193,7 @@ export class QcViewComponent implements OnInit, OnDestroy { // pd allocation to pdAllocationTo(pdData:any,childData: any) { pdData.pd_id = childData.assigned_pd; - if(pdData.fk_pd_type == 1){ + if (pdData.fk_pd_type == 1 || pdData.fk_pd_type == 3) { const dialogRef = this.dialog.open(PdAllocationComponent, { data: pdData, position: { right: '0'}, @@ -220,20 +220,20 @@ export class QcViewComponent implements OnInit, OnDestroy { this.viewPdDetails(this.viewID,this.masterRandomString) }); } - else if(pdData.fk_pd_type == 3){ - const dialogRef = this.dialog.open(TelePdAllocationComponent, { - data: pdData, - position: { right: '0'}, - width: '80%', - disableClose: true, - }); - dialogRef.afterClosed() - .subscribe(dataresult => { - // this.notifier.notify('success', 'Successfully allocated.!'); + // else if(pdData.fk_pd_type == 3){ + // const dialogRef = this.dialog.open(TelePdAllocationComponent, { + // data: pdData, + // position: { right: '0'}, + // width: '80%', + // disableClose: true, + // }); + // dialogRef.afterClosed() + // .subscribe(dataresult => { + // // this.notifier.notify('success', 'Successfully allocated.!'); - this.viewPdDetails(this.viewID,this.masterRandomString) - }); - } + // this.viewPdDetails(this.viewID,this.masterRandomString) + // }); + // } } diff --git a/ng6-seed/src/app/shared/push-notify.service.ts b/ng6-seed/src/app/shared/push-notify.service.ts index 1cdcf47e5..a85ab331b 100644 --- a/ng6-seed/src/app/shared/push-notify.service.ts +++ b/ng6-seed/src/app/shared/push-notify.service.ts @@ -68,6 +68,18 @@ export class PushNotifyService { let notify = self.create('', options).subscribe(); }) } + generateNotificationWithTitle(source: Array < any > ): void { + let self = this; + source.forEach((item) => { + let options = { + body: item.body, + icon: item.icon, + sound:'src/assets/spinner/notify.mp3', + sticky:true + }; + let notify = self.create(item.title, options).subscribe(); + }) +} } export declare type Permission = 'denied' | 'granted' | 'default'; export interface PushNotification { diff --git a/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.html b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.html new file mode 100644 index 000000000..b58982601 --- /dev/null +++ b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.html @@ -0,0 +1,26 @@ +
+
+ Incoming Call +
+
+
+ Image +
+
+
+ +
{{this.pd_info.applicant_name}}
+
{{this.pd_info.pd_sno}}
+ +
+
+
+ +
+
+ +
+
+
diff --git a/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.scss b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.scss new file mode 100644 index 000000000..b45ddba99 --- /dev/null +++ b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.scss @@ -0,0 +1,59 @@ +::ng-deep { .incoming-call-background > mat-dialog-container { + background: #71AFFF; + padding: 15px; + } +} + .label{ + margin-bottom: 5% !important; + color: white + } + .user-name { + margin: 8% !important; + h5{ + font-weight: bold; + } + h6{ + margin-top: 8px; + } + color: white + } + .call-animation { + background: #fff; + width: 135px; + height: 135px; + position: relative; + margin: 0px auto !important; + border-radius: 100%; + border: solid 5px #fff; + animation: play 2s ease infinite; + -webkit-backface-visibility: hidden; + -moz-backface-visibility: hidden; + -ms-backface-visibility: hidden; + backface-visibility: hidden; + + } + img { + width: 135px; + height: 135px; + border-radius: 100%; + position: absolute; + left: 0px; + top: 0px; + } + @keyframes play { + + 0% { + transform: scale(1); + } + 15% { + box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.4); + } + 25% { + box-shadow: 0 0 0 10px rgba(255, 255, 255, 0.4), 0 0 0 20px rgba(255, 255, 255, 0.2); + } + 25% { + box-shadow: 0 0 0 15px rgba(255, 255, 255, 0.4), 0 0 0 30px rgba(255, 255, 255, 0.2); + } + + } + \ No newline at end of file diff --git a/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.spec.ts b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.spec.ts new file mode 100644 index 000000000..75d578676 --- /dev/null +++ b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { IncomingCallComponent } from './incoming-call.component'; + +describe('IncomingCallComponent', () => { + let component: IncomingCallComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ IncomingCallComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(IncomingCallComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.ts b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.ts new file mode 100644 index 000000000..fb97afe1e --- /dev/null +++ b/ng6-seed/src/app/video-chat/incoming-call/incoming-call.component.ts @@ -0,0 +1,23 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; + +@Component({ + selector: 'app-incoming-call', + templateUrl: './incoming-call.component.html', + styleUrls: ['./incoming-call.component.scss'] +}) +export class IncomingCallComponent implements OnInit { + + constructor(private dialogRef:MatDialogRef, @Inject(MAT_DIALOG_DATA) public pd_info:any) { + console.log(this.pd_info) + } + + ngOnInit() { + } + closeDialog(){ + this.dialogRef.close('decline'); + } + answer_call(){ + this.dialogRef.close('answered'); + } +} diff --git a/ng6-seed/src/app/video-chat/video-chat.component.html b/ng6-seed/src/app/video-chat/video-chat.component.html new file mode 100644 index 000000000..9539d6f88 --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-chat.component.html @@ -0,0 +1,80 @@ +
+
+ + + + +
+ + +
+ + + +
+ +
+ + +
+

{{user_msg}}


+
+ + + +
+ + + + + +     +     + +
+
+
+
+
+ +
+ + +
+

{{displayMsg}}

+
+ +
+
+ + \ No newline at end of file diff --git a/ng6-seed/src/app/video-chat/video-chat.component.scss b/ng6-seed/src/app/video-chat/video-chat.component.scss new file mode 100644 index 000000000..b26518120 --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-chat.component.scss @@ -0,0 +1,79 @@ +::ng-deep { .video-chat > mat-dialog-container { + background: #eee; + padding: 0; + } +} + + +@media(max-width:500px) { + + video#myvideo { + max-width: 32%; + // min-width: 150px; + position: absolute; + border: 2px solid #9E9E9E; + top:0; + left: 0; + // /* top: 20px; +} +.body-container { + padding: 0px !important; +} +video#peervideo { + /* height: 498px; */ + // position: relative; + // margin-top: 126px; + width: 100%; + margin-top: 5%; + +} + +// .peer_message{ +// font-size: 20px; +// position: absolute; +// top: 11%; +// bottom: 10%; +// float: right; +// padding: 57px; +// /* border: 2px solid lavender; */ +// left: 8%; +// p{ +// text-align: center; +// } +// } + } + @media(min-width:500px) { + .peer_video{ + max-height: 80vh; + } + video#myvideo { + max-width: 22%; + // min-width: 150px; + position: absolute; + border: 2px solid #9E9E9E; + top:0; + left: 0; + // max-width: 45%; + // text-align: center; + // margin-left:3%; + // margin-top:1%; + // min-width: 150px; + // position: absolute; + // border: 2px solid #9E9E9E; + // /* top: 20px; +} + +video#peervideo { + /* height: 498px; */ + max-width: 100%; + text-align: center; + margin-left:3%; + margin-top:1%; + // position: relative; + // margin-top: 126px; + // width: 100%; +} +} +body{ + margin:10px !important; +} diff --git a/ng6-seed/src/app/video-chat/video-chat.component.spec.ts b/ng6-seed/src/app/video-chat/video-chat.component.spec.ts new file mode 100644 index 000000000..69efedd43 --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-chat.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { VideoChatComponent } from './video-chat.component'; + +describe('VideoChatComponent', () => { + let component: VideoChatComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ VideoChatComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(VideoChatComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/video-chat/video-chat.component.ts b/ng6-seed/src/app/video-chat/video-chat.component.ts new file mode 100644 index 000000000..999907b5e --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-chat.component.ts @@ -0,0 +1,600 @@ +import { Component, OnInit, ChangeDetectorRef, ViewChild, Inject, HostListener } from '@angular/core'; +import { Observable } from 'rxjs'; +import { PushNotifyService } from 'app/shared/push-notify.service'; +import { Socket } from 'ngx-socket-io'; +import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material'; +import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; +@Component({ + selector: 'app-video-chat', + templateUrl: './video-chat.component.html', + styleUrls: ['./video-chat.component.scss'] +}) +export class VideoChatComponent implements OnInit { + MediaStream + title = 'simple-peer-video-chat'; + peer:any; + targetpeer: string; + enableBtn: boolean; + @ViewChild('myvideo') myVideo: any; + @ViewChild('peervideo') peervideo: any; + @ViewChild('camera_switch') camereSwitchBtn: any; + // @ViewChild('textToCopy',{static:true}) textCopyElement: any; + n = navigator.mediaDevices; + // public textToCopy:any; + myVideoEnable: boolean = false; + peerVideoEnable: boolean = false; + shouldFaceUser: boolean = true; + userCallType: any; + is_video_enable:boolean = false; + mic_mute: boolean = true; + video_mute: boolean = true; + user_msg: string; + recorder: any; + start_btn_enable:boolean = true + displayMsg:string = "Note : Make sure the Reciever is waiting for your call before start Calling" + arr_of_blobs: any = []; + constructor(private _notificationService:PushNotifyService, + private cdRef: ChangeDetectorRef,private socket: Socket, + private dialogRef: MatDialogRef, + @Inject(MAT_DIALOG_DATA) public chat_info:any,private pdTriggerService:PdTrigerService) { + this._notificationService.requestPermission(); + // this.notify('Approval','This is First Alert -- By Debasis Saha') + console.log("Version #8") + } + notify(title,approval) { + let data: Array < any >= []; + data.push({ + 'title': title, + 'body': approval + }); + this._notificationService.generateNotificationWithTitle(data); +} + // ngOnInit() { + // setTimeout(()=>{ + // console.log("ngOninti") + // this.peer = new SimplePeer({ + // initiator: location.hash === '#init', + // trickle: false + // }) + // console.log(this.peer) + // this.peer.on('signal', function(data) { + // console.log(JSON.stringify(data)); + + // this.targetpeer = data; + // }) + // this.peer.on('error', err => console.log('error', err)) + // this.peer.on('data', function(data) { + // console.log('Recieved message:' + data); + // this.notify('notify',data) + // }) + // this.peer.on('connect', () => { + // console.log('CONNECT') + // this.peer.send('whatever' + Math.random()) + // }) + // setTimeout(()=>{ + // console.log("updated") + // this.enableBtn=true + // this.notify('notify','enabled') + // },1000) + // },3000) + // } + + ngOnInit() { + console.log(this.chat_info); + if(this.chat_info) { + if(this.chat_info.type == 'offer' && this.chat_info.hasOwnProperty('JSON_to_connect') && this.chat_info.JSON_to_connect) { + this.is_video_enable = true; + this.start_Calling('receive') + } + } + // this.start_Calling('receive') + } + start_Calling(option) { + this.user_msg ="Establishing Connection..." + this.userCallType = option + // let texk=this.textCopyElement.nativeElement + let video = this.myVideo.nativeElement; + let peerVideo = this.peervideo.nativeElement + let peerx: any; + let copyMessageText + this.n.getUserMedia = (this.n.getUserMedia || this.n.webkitGetUserMedia || this.n.mozGetUserMedia || this.n.msGetUserMedia); + if(this.n.getUserMedia == undefined || this.n.getUserMedia == null, this.n.getUserMedia == ''){ + alert("unable to get the camera access. please close the browser and come back again") + } + console.log(this.n) + let defaultsOpts = { audio: true, video: { + facingMode: this.shouldFaceUser ? 'user' : 'environment' + } + } + this.n.getUserMedia(defaultsOpts).then(stream=> { + this.socket.emit('NewClient') + video.load(); + video.muted = true; + this.fetchVideoAndPlay(stream,video); + this.myVideoEnable = true + this.MediaStream = stream + this.is_video_enable = true; + // let switchCameraBtn= this.camereSwitchBtn.nativeElement + let supports = navigator.mediaDevices.getSupportedConstraints(); + console.log(supports) + if( supports['facingMode'] === true ) { + // switchCameraBtn.disabled = false; +} + console.log("entered",stream); + peerx = new SimplePeer ({ + initiator: option === 'init', + stream: stream, + reconnectTimer: 1000, + iceTransportPolicy: 'relay', + trickle: false, + config: { + iceServers: [ + { + "urls": "stun:numb.viagenie.ca", + "username": 'fairoj@venbainfotech.com', + "credential": '0987123400' + }, + { + "urls": "turn:numb.viagenie.ca", + "username": "fairoj@venbainfotech.com", + "credential": "0987123400" + } + ] + } + }) + + // function InitPeer(type) { + peerx.on('signal',(data)=> { + + console.log(JSON.stringify(data)); + if(data.hasOwnProperty('type') && data.type == 'offer'){ + console.log("entered!!!!!!!!!!!!!!!!1"); + this.user_msg = "Calling..." + let event_data = {JSON_to_connect:data,type:'offer',random_string:this.chat_info.random_string,user_type:"officer"} + this.socket.emit('Offer', event_data) + } + else if(data.type == 'answer' ){ + this.user_msg = "Waiting For Connection..." + let event_data = {JSON_to_connect:data,type:'answer',random_string:this.chat_info.random_string,user_type:"officer"} + this.socket.emit('Answer', event_data) + } + // copyMessage(JSON.stringify(data)) + copyMessageText = JSON.stringify(data); + // update() + // this.copyMessage(copyMessageText,data.type) + // this.targetpeer = data; + }) + // } + peerx.on('data', function(data) { + console.log('Recieved message:' + data); + }) + peerx.on('close', (data) => { + console.log("Peer Connection is closed ",data); + this.disconnect(); + // alert("Peer Connection is closed " +JSON.stringify(data)) + this.notify("Connection Closed",'Peer Connection Closed') + }) + peerx.on('error', (err) => { + console.log("Fatal Error ",err); + this.disconnect(); + alert("Fatal Error" +JSON.stringify(err)) + }) + peerx.on('stream', (stream)=> { + console.log("@##################33",stream) + if ('srcObject' in peerVideo) { + peerVideo.srcObject = stream + } else { + peerVideo.src = window.URL.createObjectURL(stream) // for older browsers + } + // video.play(); + + // console.log(this.peerVideoEnable); + peerVideo.load(); + this. fetchVideoAndPlay(stream,peerVideo,true); + // setTimeout(()=>{ + // // this.peerVideoEnable = true; + // // console.log(this.peerVideoEnable) + // },2000) + // CreateVideo(stream) + }) + // fetchVideoAndPlay(stream,videotype) { + // fetch('') + // .then(response => response.blob()) + // .then(blob => { + // videotype.srcObject = stream; + // return videotype.play(); + // }) + // .then(_ => { + // // Video playback started ;) + // }) + // .catch(e => { + // // Video playback failed ;( + // }) + // } + + // function CreateVideo(stream) { + // // CreateDiv() + + // let video = document.createElement('video') + // video.id = 'peerVideo' + // video.srcObject = stream + // video.setAttribute('class', 'embed-responsive-item') + // document.querySelector('#peervideo').appendChild(video) + // video.play() + // //wait for 1 sec + // } + function connectPeer(answer) { + console.log("$$$$$$$$$$$$$$44"); + console.log(answer); + setTimeout(()=>{ + peerx.signal(answer.JSON_to_connect); + },1000) + } + // function getPeer(){ + // return JSON.stringify(copyMessageText) + // } + // if(JSON.parse(copyMessageText).hasOwnProperty('type') && JSON.parse(copyMessageText).type == 'offer') + // { +// setTimeout(()=>{ +// this.socket.on('BackOffer', getPeer) +// },2000) + // } + if(this.chat_info.type == 'offer' && this.chat_info.JSON_to_connect && this.chat_info.JSON_to_connect != undefined) { + connectPeer(this.chat_info) + } + // let tt = this.socket.on('BackOffer', connectPeer) + // console.log(tt); + this.socket.on('BackAnswer', connectPeer) + }, err=>{ + console.log('Failed to get stream', err); + alert('Failed to get stream '+err); + }); + this.socket.on('callStatusMessage',this.updateTheMsg) + this.socket.fromEvent('callStatusMessage').subscribe(res=>{ + if(res) { + this.updateTheMsg(res) + } + }) + // function update(){ + // console.log(copyMessageText) + // setTimeout(()=>{ + // // texk.value = copyMessageText + // },2000) + // } + setTimeout(() => { + this.peer = peerx; + + // this.copyMessage(JSON.stringify(this.targetpeer)) + console.log(this.peer); + // console.log(copyMessageText) + // this.targetpeer = copyMessageText + // this.textToCopy = copyMessageText + // this.copyMessage(copyMessageText) + }, 5000); + + // socket.on('SessionActive', SessionActive) + // socket.on('CreatePeer', MakePeer) + // socket.on('Disconnect', RemovePeer) + } + updateTheMsg(msg_obj) { + console.log("CallstatusMsg",msg_obj) + if(msg_obj && msg_obj.status_code == 2){ + console.log("entered"); + this.start_btn_enable = false + this.displayMsg = msg_obj.msg + // this.cdRef.detectChanges(); + this.disconnect(); + + } + } + fetchVideoAndPlay(stream,videotype,enablePeerVideo?) { + console.log("12@@@@@@@@@2",enablePeerVideo) + + fetch('') + .then(response => response.blob()) + .then(blob => { + videotype.srcObject = stream; + return videotype.play(); + }) + .then(_ => { + // Video playback started ;) + if(enablePeerVideo) { + if(this.peervideo.nativeElement.videoHeight >= 500) { + this.peervideo.nativeElement.style.marginTop = '0px' + } + this.peerVideoEnable = enablePeerVideo + this.socket.emit('callStatus',{random_string:this.chat_info.random_string,status:'connected',status_code:1}) + // this.camereSwitchBtn.nativeElement.disabled = true; + console.log("peervideo check",this.peerVideoEnable,this.peervideo.nativeElement.videoWidth,this.peervideo.nativeElement.videoHeight); + this.cdRef.detectChanges(); + this.startRecording(stream) + // this.addVideoToRecorder(stream) + // this.addVideoToRecorder(this.MediaStream) + } + }) + .catch(e => { + // Video playback failed ;( + }) + } + async startRecording(stream) { + // console.log("start",stream,this.peervideo) + this.recorder = [] + this.recorder = new RecordRTCPromisesHandler(stream, { + type: 'video', + mimeType: 'video/webm\;codecs=vp9', // or video/webm\;codecs=h264 or video/webm\;codecs=vp9 + // timeSlice: 10000, + // ondataavailable: (blob=> { this.sendPartVideo(blob) }), + audioBitsPerSecond: 128000, + videoBitsPerSecond: 128000, + bitsPerSecond: 128000 // if this line is provided, skip above + }); + this.recorder.startRecording(); + // const sleep = m => new Promise(r => setTimeout(r, m)); + // await sleep(3000); +setTimeout(()=>{ +this.stopRecording(true); +},120000); +// var file = new File([blob], 'video.mp4', { +// type: 'video/mp4' +// }); +// console.log(file) +// const fileURL = window.URL.createObjectURL(file); +// window.open(fileURL); +// videotype.srcObject = null; +// videotype.muted = false; +// videotype.volume = 1; +// videotype.srcObject = file; + + + // recorder.camera.stop(); + // recorder.destroy(); + // recorder = null; +// let recorder = RecordRTC(stream, { +// type: 'video' +// }); +// recorder.startRecording(); + +// const sleep = m => new Promise(r => setTimeout(r, m)); +// sleep(10000); + +// recorder.stopRecording(function() { +// let blob = recorder.getBlob(); +// // invokeSaveAsDialog(blob); +// console.log(blob); +// }); + +// blob.then(resul=>{ +// console.log(resul); +// }) +// const fileURL = window.URL.createObjectURL(blob); +// console.log(fileURL); +// window.open(fileURL); +// invokeSaveAsDialog(blob); + } + // sendPartVideo(blob){ + // this.arr_of_blobs.push(blob); + // console.log("Blob",blob,JSON.stringify(blob)); + // var file = new File([blob], 'video.mp4', { + // type: 'video/mp4' + // }); + // console.log(file,JSON.stringify(file)); + // let formData = new FormData(); + // formData.append('video', blob); + // const fileURL1 = window.URL.createObjectURL(blob); + // console.log('video'+this.arr_of_blobs.length+'.mp4',fileURL1); + // formData.append('filename','video'+this.arr_of_blobs.length+'.mp4'); + // formData.append('random_string',this.chat_info.random_string); + // console.log(formData); + // this.pdTriggerService.saveVideo(formData).subscribe(result=>{ + // console.log(result); + // }) + // } + async stopRecording(autostarRec?) { + await this.recorder.stopRecording(); + // console.log(this.recorder); + let blob = await this.recorder.getBlob(); + if(autostarRec) { + await this.startRecording(this.peervideo.nativeElement.srcObject) + } + // setTimeout(()=>{ + console.log(typeof(blob),blob); + console.log(RecordRTC,RecordRTCPromisesHandler) + await RecordRTC.getSeekableBlob(blob, seekableBlob=> { + console.log(seekableBlob) + const fileURL = window.URL.createObjectURL(seekableBlob); + console.log("seekable file",fileURL) + this.arr_of_blobs.push(seekableBlob) + console.log("----------------------------") + console.log("video "+this.arr_of_blobs.length, fileURL) + console.log("----------------------------") + this.sendVideoToServer(seekableBlob) + }) + + // var file = new File([blob], 'video.mp4', { + // type: 'video/mp4' + // }); + // const fileURL = window.URL.createObjectURL(blob); + // this.arr_of_blobs.push(blob) + // console.log("----------------------------") + // console.log("video "+this.arr_of_blobs.length, fileURL) + // console.log("----------------------------") + if(!autostarRec) { + let mergedVideos=this.arr_of_blobs.reduce((a, b)=> new Blob([a, b], {type: "video/webm"})); + console.log("merged",mergedVideos,this.arr_of_blobs); + const fileURL1 = window.URL.createObjectURL(mergedVideos); + // localStorage.setItem('blob_url',fileURL1) + console.log("File url 11111",fileURL1) + window.open(fileURL1) + } + + // let formData= new FormData(); + // formData.append('videoFile',file); + // console.log(formData); + // alert("saved Recording will be opened in a new window"); + // window.open(fileURL); + // },3000); + // this.recorder.getDataURL().then(dataURL=>{ + // console.log("@@@@@",dataURL) + + // }) +} +sendVideoToServer(blob) { + let formData = new FormData(); + formData.append('video_file', blob); + let params = { + filename:'video'+this.arr_of_blobs.length+'.mp4', + random_string:this.chat_info.random_string, + pd_id:this.chat_info.pd_id + } + formData.append('records',JSON.stringify(params)) + // formData.append('filename','video'+this.arr_of_blobs.length+'.mp4'); + // formData.append('random_string',this.chat_info.random_string); + // formData.append('pd_id',this.chat_info.pd_id); + this.pdTriggerService.saveCusVideo(formData).subscribe(result=>{ + console.log(result); + }) +} + connect() { + this.peer.signal(JSON.parse(this.targetpeer)); + } + RemovePeer() { + document.getElementById("peerVideo").remove(); + // document.getElementById("muteText").remove(); + // if (client.peer) { + // client.peer.destroy() + // } +} + + message() { + this.peer.send('Hello world'); + } + disconnect() { + console.log(this.peer) + if(this.peer) { + this.peer.destroy(); + this.peerVideoEnable = false + this.targetpeer = '' + this.peer = '' + // this.cdRef.detectChanges(); + this.socket.emit('callStatus',{random_string:this.chat_info.random_string,status:'disconnected',status_code:0}) + this.peervideo.nativeElement.pause(); + this.stopRecording().then(res=>{ + + }) + // this.stopAndGetSingleBlob(function(blob) { + // var url = URL.createObjectURL(blob); + // // previewVideo.src = url; + // console.log(blob,url); + // // or + // window.open(url); + + // // or + // // invokeSaveAsDialog(blob); + // }); + } + console.log(this.MediaStream.getTracks()) + // this.MediaStream.stop() + // var track = this.MediaStream.getTracks()[0]; // if only one media track + // ... + // track.stop(); + this.MediaStream.getTracks().forEach(function(track) { + track.stop(); + }); + console.log(this.peervideo); + // this.peervideo.nativeElement.videoWidth = 0 + // this.peervideo.nativeElement.videoHeight = 0 + this.myVideo.nativeElement.pause(); + this.is_video_enable = false + this.cdRef.detectChanges(); + console.log(this.peer) + } + copyMessage(val: string,message?){ + const selBox = document.createElement('textarea'); + selBox.style.position = 'fixed'; + selBox.style.left = '0'; + selBox.style.top = '0'; + selBox.style.opacity = '0'; + selBox.value = val; + document.body.appendChild(selBox); + selBox.focus(); + selBox.select(); + document.execCommand('copy'); + document.body.removeChild(selBox); + // alert(message+ " JSON is copied to clipboard. Paste the JSON to another window") + this.notify("JSON copied to clipboard",message+ ' JSON'); + } + switch_camera() { + this.shouldFaceUser = !this.shouldFaceUser; + console.log(this.userCallType); + this.peer.destroy(); + this.start_Calling(this.userCallType) + } + close_all() { + if(this.peer) { + this.disconnect(); + } + if(this.MediaStream && this.MediaStream.active) { + console.log(this.MediaStream.getTracks()) + // this.MediaStream.stop() + // var track = this.MediaStream.getTracks()[0]; // if only one media track + // ... + // track.stop(); + this.MediaStream.getTracks().forEach(function(track) { + track.stop(); + }); + } + this.dialogRef.close(); + } + micMuteHandling(){ + this.mic_mute = !this.mic_mute + this.cdRef.detectChanges(); + this.MediaStream.getAudioTracks()[0].enabled = this.mic_mute; + } + videoHandling(){ + this.video_mute = !this.video_mute + this.cdRef.detectChanges(); + this.MediaStream.getVideoTracks()[0].enabled = this.video_mute; + } + clearRandomString() { + if(this.peer) { + this.disconnect() } + else{ + this.socket.emit('callStatus',{random_string:this.chat_info.random_string,status:'disconnected',status_code:0}) + } + } + + @HostListener('window:beforeunload', ['$event']) + unloadHandler(event) { + console.log("unload caled",event); + if(this.peerVideoEnable) { + this.disconnect(); + } + } + // RECORDING MULTIPLE VIDEOS + +// addVideoToRecorder(stream) { +// // var stream = video.captureStream(); + +// if (!this.recorder) { +// this.recorder = RecordRTC([stream], { +// type: 'video' +// }); +// this.recorder.startRecording(); +// } else { +// this.recorder.getInternalRecorder().addStreams([stream]); +// } +// } + +// async stopAndGetSingleBlob(callback) { +// if (!this.recorder) return; +// await this.recorder.stopRecording(()=> { +// // setTimeout(()=>{ +// callback(this.recorder.getBlob()); +// setTimeout(()=>{ +// console.log(this.recorder.getBlob()); +// },3000) +// // }) +// this.recorder = null; +// }); +// } +} diff --git a/ng6-seed/src/app/video-chat/video-player/video-player.component.html b/ng6-seed/src/app/video-chat/video-player/video-player.component.html new file mode 100644 index 000000000..755bd2183 --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-player/video-player.component.html @@ -0,0 +1,22 @@ +
+ + + + +
+ + + + + + + \ No newline at end of file diff --git a/ng6-seed/src/app/video-chat/video-player/video-player.component.scss b/ng6-seed/src/app/video-chat/video-player/video-player.component.scss new file mode 100644 index 000000000..146c20da7 --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-player/video-player.component.scss @@ -0,0 +1,9 @@ +::ng-deep { .video-player > mat-dialog-container { + background: rgba(255, 0, 0, 0.705); + padding: 0; + } +} +.mat-raised-button{ + color: #ffffff; + background: #ffffff5c; +} \ No newline at end of file diff --git a/ng6-seed/src/app/video-chat/video-player/video-player.component.spec.ts b/ng6-seed/src/app/video-chat/video-player/video-player.component.spec.ts new file mode 100644 index 000000000..e4f72b3ae --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-player/video-player.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { VideoPlayerComponent } from './video-player.component'; + +describe('VideoPlayerComponent', () => { + let component: VideoPlayerComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ VideoPlayerComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(VideoPlayerComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/video-chat/video-player/video-player.component.ts b/ng6-seed/src/app/video-chat/video-player/video-player.component.ts new file mode 100644 index 000000000..b99550dd7 --- /dev/null +++ b/ng6-seed/src/app/video-chat/video-player/video-player.component.ts @@ -0,0 +1,29 @@ +import { Component, OnInit, Inject } from '@angular/core'; +import { MAT_DIALOG_DATA, MatDialogRef } from '@angular/material'; + +@Component({ + selector: 'app-video-player', + templateUrl: './video-player.component.html', + styleUrls: ['./video-player.component.scss'] +}) +export class VideoPlayerComponent implements OnInit { + videoSrc + // = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4' + // = 'http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/ForBiggerFun.mp4' + constructor( @Inject(MAT_DIALOG_DATA) public data:any,private matDialogRef:MatDialogRef) { + if(data) { + if(data.hasOwnProperty('videoUrl') && data.videoUrl && data.videoUrl != null) { + this.videoSrc = data.videoUrl + } + } + } + + ngOnInit() { + let video_blob = localStorage.getItem('blob_url'); + if(video_blob) { + // this.videoSrc = video_blob; + console.log(this.videoSrc); + } + } + +} diff --git a/ng6-seed/src/assets/images/img/video-icon.png b/ng6-seed/src/assets/images/img/video-icon.png new file mode 100644 index 000000000..3a0ed9287 Binary files /dev/null and b/ng6-seed/src/assets/images/img/video-icon.png differ diff --git a/ng6-seed/src/assets/spinner/notfound.jpg b/ng6-seed/src/assets/spinner/notfound.jpg new file mode 100644 index 000000000..900f35aeb Binary files /dev/null and b/ng6-seed/src/assets/spinner/notfound.jpg differ diff --git a/ng6-seed/src/assets/spinner/notfound2.jpg b/ng6-seed/src/assets/spinner/notfound2.jpg new file mode 100644 index 000000000..25a1d3348 Binary files /dev/null and b/ng6-seed/src/assets/spinner/notfound2.jpg differ diff --git a/ng6-seed/src/assets/spinner/notfound_blue.png b/ng6-seed/src/assets/spinner/notfound_blue.png new file mode 100644 index 000000000..cf1f5a7f3 Binary files /dev/null and b/ng6-seed/src/assets/spinner/notfound_blue.png differ diff --git a/ng6-seed/src/assets/spinner/notify.mp3 b/ng6-seed/src/assets/spinner/notify.mp3 new file mode 100644 index 000000000..9e859af35 Binary files /dev/null and b/ng6-seed/src/assets/spinner/notify.mp3 differ diff --git a/ng6-seed/src/environments/environment.prod.ts b/ng6-seed/src/environments/environment.prod.ts index f0f0f2284..33feca4ac 100755 --- a/ng6-seed/src/environments/environment.prod.ts +++ b/ng6-seed/src/environments/environment.prod.ts @@ -4,6 +4,7 @@ export const environment = { environmentName: 'Production Environment',//Live Environment. apiEndpoint: 'https://api.pdgenie.com/sparqprod/api/', + socketServerUrl:'https://morning-garden-90282.herokuapp.com', authorization: 'TnAwuc64pVpcB9xf', login_string: "cognito-idp.ap-south-1.amazonaws.com/ap-south-1_MlTee1O5V", diff --git a/ng6-seed/src/environments/environment.stage.ts b/ng6-seed/src/environments/environment.stage.ts index 0b9f4430f..b90a99fbf 100644 --- a/ng6-seed/src/environments/environment.stage.ts +++ b/ng6-seed/src/environments/environment.stage.ts @@ -4,6 +4,7 @@ export const environment = { environmentName: 'Testing Environment',//Test Environment. apiEndpoint: 'https://apitest.pdgenie.com/sparqtest/api/', + socketServerUrl:'https://morning-garden-90282.herokuapp.com', authorization: 'sparqvenba2018', login_string: "cognito-idp.ap-south-1.amazonaws.com/ap-south-1_qQ85yQZJO", diff --git a/ng6-seed/src/environments/environment.ts b/ng6-seed/src/environments/environment.ts index 48db2bf0a..29face7a0 100755 --- a/ng6-seed/src/environments/environment.ts +++ b/ng6-seed/src/environments/environment.ts @@ -14,6 +14,7 @@ export const environment = { // apiEndpoint: 'https://demo.pdgenie.com/sparqapi/api/', apiEndpoint:'https://apitest.pdgenie.com/sparqtest/api/', // apiEndpoint:'http://localhost/sineEdge/sparqapi/api/', + socketServerUrl:'https://morning-garden-90282.herokuapp.com', authorization: 'sparqvenba2018', diff --git a/ng6-seed/src/index.html b/ng6-seed/src/index.html index 963d27c67..615284e0f 100755 --- a/ng6-seed/src/index.html +++ b/ng6-seed/src/index.html @@ -9,6 +9,11 @@ + + + + + PD Genie diff --git a/ng6-seed/src/typings.d.ts b/ng6-seed/src/typings.d.ts index a0786e36b..2c420c444 100755 --- a/ng6-seed/src/typings.d.ts +++ b/ng6-seed/src/typings.d.ts @@ -6,4 +6,7 @@ interface NodeModule { declare module 'quill'; declare module 'leaflet'; declare module 'perfect-scrollbar'; -declare module 'screenfull'; \ No newline at end of file +declare module 'screenfull'; +declare var SimplePeer: any; +declare var RecordRTCPromisesHandler:any; +declare var RecordRTC:any; \ No newline at end of file