スキップしてメイン コンテンツに移動

投稿

5月, 2020の投稿を表示しています

[Angular] Test Components

Intro This time, I tested a component of Angular.  [Angular]Test with Azure DevOps Sample Test target was here. first-page.component.html <p>first-page works!</p> <div id="product-list" *ngFor="let p of products"> <div class="product-id">ID: {{p.id}}</div> <div class="product-name">NAME: {{p.name}}</div> </div> <button id="load-button" (click)="loadProducts()"></button> <input id="input-file" type="file" (change)="fileChanged($event.target)" > <button id="save-button" (click)="saveFile()">Save</button> first-page.component.ts import { Component, OnInit } from '@angular/core'; import { FirstPageService } from './first-page.service'; import { Product } from '../products/product'; import { FileUploadService } from '../file-upload/file-upload.service'; @C

[Node.js][TypeScript] Play with WebRTC

Intro Finally, I could try WebRTC. I used the code what I had wrote last time. [Nest.js] Use WebSocket with ws First, I accessed Camera and Mic from Web browser. After that, I opened two client pages and connected them by WebSocket and WebRTC. I referred MDN sample. samples-server/s/webrtc-from-chat at master · mdn/samples-server · GitHub And I also referred this. Building a WebRTC video broadcast using Javascript Access Camera and Mic Adapter.js According to MDN documents, I should install Adapter.js for interoperability between Web browsers. WebRTC API - Web APIs | MDN GitHub - webrtc/adapter: READ ONLY FORK: Shim to insulate apps from spec changes and prefix differences. Latest adapter.js release: But at least in this time, I felt I didn't have to do that. Thus, I didn't install it. getUserMedia I could access Camera and Mic by "getUserMedia". [client-side] index.html <!DOCTYPE html> <html> <head> <title>Index page<

[Nest.js] Use WebSocket with ws

Intro Until last time , I had used node-web-rtc to try WebRTC. But because the example was a little complicated for I understood the core functions of using WebRTC. So I look for other frameworks or libraries. PeerJS is a famous library for WebRTC. peers/peerjs: Peer-to-peer data in the browser. - GitHub peers/peerjs-server: Server for PeerJS - GitHub PeerJS - Simple peer-to-peer with WebRTC A problem is I don't know how to integrate to the Nest.js project. I couldn't find examples. So I don't choose at least this time. What shall I choose? According MDN, WebRTC doesn't specify strictly what technology is used on server application for connecting two devices. Signaling and video calling - Web APIs | MDN But in many examples include MDN's one use WebSocket. samples-server/s/webrtc-from-chat at master · mdn/samples-server · GitHub So I try WebSocket in the Nest.js project. Use WebSocket in a Nest.js project Nest.js has a function for using We