投稿時間:2020-05-14 00:47:09 RSSフィード2020-05-14 00:00 分まとめ(54件)

カテゴリー等 サイト名等 記事タイトル・トレンドワード等 リンクURL 頻出ワード・要約等/検索ボリューム 登録日
IT 気になる、記になる… Amazon、新型「Fire HD 8 タブレット」を発表 − 本日より予約受付開始 https://taisy0.com/2020/05/13/121593.html amazon 2020-05-13 14:18:05
AWS AWS Japan Blog 金融機関で活用される AWS のテレワーク支援サービス https://aws.amazon.com/jp/blogs/news/%E9%87%91%E8%9E%8D%E6%A9%9F%E9%96%A2%E3%81%A7%E6%B4%BB%E7%94%A8%E3%81%95%E3%82%8C%E3%82%8B-aws-%E3%81%AE%E3%83%86%E3%83%AC%E3%83%AF%E3%83%BC%E3%82%AF%E6%94%AF%E6%8F%B4%E3%82%B5%E3%83%BC%E3%83%93/ nbsp在宅コンタクトセンターの実現をご支援するAmazonConnect金融機関の皆様における在宅勤務の促進という観点では、多くのスタッフで集中的にお客様対応を担うコンタクトセンターの在宅対応を可能にすることは、大きなポイントの一つになると考えます。 2020-05-13 14:27:09
python Pythonタグが付けられた新着投稿 - Qiita Lチカで始めるテスト自動化 https://qiita.com/pbjpkas/items/fd4bd2689deda2d793aa 手順確認したいこと操作期待値テスト治具のモデル名などが正しいことテスト治具にコマンドiを送るコマンドの戻り値が期待通りの文字列であることリレーがアサインされているピン番号が正しいことテスト治具にコマンドpを送るコマンドの戻り値がであることスイッチを閉じるとLEDが点灯するテスト治具にコマンドnを送るテスト対象のLEDが点灯することテスト治具にコマンドvを送るコマンドの戻り値がより大きくより小さいことスイッチを開くとLEDが消灯するテスト治具にコマンドfを送るテスト対象のLEDが消灯することテスト治具にコマンドvを送るコマンドの戻り値がより小さいことテストランナーの実装章のテストを実行できるようなテストランナーを実装します。 2020-05-13 23:50:35
python Pythonタグが付けられた新着投稿 - Qiita 【Udemy Python3入門+応用】 60. リスト内包表記 https://qiita.com/cyrus_qiita/items/38ee57c50380f93568ee リスト内包表記で記述した場合triforiintprintrresult内に上のように記述することで、リストに直接追加していくことができる。 2020-05-13 23:48:56
python Pythonタグが付けられた新着投稿 - Qiita Tensorflowメモ https://qiita.com/_tennenpama_/items/5382760fd684a7cb6b1a AnacondaVSCodeTensorflowでintellisenseが効かない場合の対処法VSCodeでTensorflowを利用していると、おそらくintellisenseが効かない。 2020-05-13 23:46:50
python Pythonタグが付けられた新着投稿 - Qiita 【Udemy Python3入門+応用】 59. ジェネレーター https://qiita.com/cyrus_qiita/items/77693e9df64463e41840 【UdemyPython入門応用】ジェネレーター※この記事はUdemyの「現役シリコンバレーエンジニアが教えるPython入門応用アメリカのシリコンバレー流コードスタイル」の講座を受講した上での、自分用の授業ノートです。 2020-05-13 23:33:16
js JavaScriptタグが付けられた新着投稿 - Qiita 新しく作成した.jsファイルが読み込まれない https://qiita.com/thikeshi777/items/d7cf98eb1c5eda78d346 新しく作成したjsファイルが読み込まれない新しく作成したjsファイルが読み込まれないjQueryで追加機能を新しいファイルに書き込み実装したところ、うまく起動しなかった。 2020-05-13 23:48:11
js JavaScriptタグが付けられた新着投稿 - Qiita OutSystemsでJavaScriptからScreen Actionを起動する(Traditional Web) https://qiita.com/jyunji_watanabe/items/0083c861f2a5a5e8b824 OutSystemsでJavaScriptからScreenActionを起動するTraditionalWebブラウザ内で動作するJavaScriptの処理を起点として、ScreenActionを動作させてみます。 2020-05-13 23:00:52
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 当選番号が一致してる個数を出す https://teratail.com/questions/261345?rss=all 当選番号が一致してる個数を出す当選番号が一致している個数を出すプログラムを作成しています。 2020-05-13 23:50:29
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) ネットに乗っていたJavaScriptだけで作られた特殊なボタンをクリックしたらリンクに飛ぶようにしたいです。 https://teratail.com/questions/261344?rss=all ネットに乗っていたJavaScriptだけで作られた特殊なボタンをクリックしたらリンクに飛ぶようにしたいです。 2020-05-13 23:50:24
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) iOS13でfirebaseのDynamicLinkがうまく動かない https://teratail.com/questions/261343?rss=all 現在、swiftにてiOSアプリを開発しております。 2020-05-13 23:27:50
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) Macでandroid studioのCPU使用率が異常に高い https://teratail.com/questions/261342?rss=all MacでandroidstudioのCPU使用率が異常に高い発生している問題androidnbspstudioで開発中に突然CPUの使用率が異常に高い状態が続くようになってしましました。 2020-05-13 23:19:23
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) 主キーでないカラムtelを子に認識させたい https://teratail.com/questions/261341?rss=all 主キーでないカラムtelを子に認識させたいこんばんわ。 2020-05-13 23:04:11
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) modpowがわからない https://teratail.com/questions/261340?rss=all modpowがわからないmodpowを高速で計算したいプログラミングの問題でnmmodPを計算する時、回ずつnをm回かけるとTLEになってしまいました。 2020-05-13 23:02:58
Program [全てのタグ]の新着質問一覧|teratail(テラテイル) PUN2 突然オブジェクトがDestroyされる https://teratail.com/questions/261339?rss=all PUN突然オブジェクトがDestroyされるプレイヤーオブジェクトがシーン開始約秒後に勝手にDestroyされます。 2020-05-13 23:02:53
Ruby Rubyタグが付けられた新着投稿 - Qiita マイグレーションファイルを修正する https://qiita.com/yuya_maru2/items/87df1377cbef733c7647 マイグレーションファイルを修正するdown状態のマイグレーションファイルのミスのあるところを修正します。 2020-05-13 23:54:51
Ruby Rubyタグが付けられた新着投稿 - Qiita 新しく作成した.jsファイルが読み込まれない https://qiita.com/thikeshi777/items/d7cf98eb1c5eda78d346 新しく作成したjsファイルが読み込まれない新しく作成したjsファイルが読み込まれないjQueryで追加機能を新しいファイルに書き込み実装したところ、うまく起動しなかった。 2020-05-13 23:48:11
Ruby Rubyタグが付けられた新着投稿 - Qiita ローカルサーバーがすでに起動していると言われてrails sできない時の対処 https://qiita.com/daiki421/items/28d5871411132ba52af0 killsudokillltpidgt 2020-05-13 23:25:06
Ruby Rubyタグが付けられた新着投稿 - Qiita 【Rails Error】No such table userと言われた https://qiita.com/facultyoflaw11/items/a33bf5be5984a75d407b 【RailsError】Nosuchtableuserと言われた【RailsError】Nosuchtableuserと言われたあるとき、Deviseを導入した時に、こんなエラーが出たterminalgtrailsdbmigrateAddDeviseToUsersmigratingchangetableusersrailsabortedStandardErrorAnerrorhasoccurredthisandalllatermigrationscanceledSQLiteSQLExceptionnosuchtableusersUserテーブルがないとおとはいえrailsgdeviseuserをしてもrailsgmodeluserをしても反応しないじゃないか無いからダメって言われて、じゃあ作ろうとしたら怒るってどんなツンデレよあれこれ調べていると、adddevisetouserrbclassAddDeviseToUsersltActiveRecordMigrationdefselfupchangetableusersdotDatabaseauthenticatabletstringemailnullfalsedefaultなんかこのコードの行目にchangetableってあるぞなんか怪しい。 2020-05-13 23:04:31
AWS AWSタグが付けられた新着投稿 - Qiita AWS CloudFormation で組み込み関数を併用 https://qiita.com/ctakenabe/items/7e7aad12ef50408f45f5 AWSCloudFormationで組み込み関数を併用概要AWSCloudFormationでテンプレートを作成していると、組み込み関数RefとかSubとかのことの中で組み込み関数を使用したくなることがある。 2020-05-13 23:34:44
Docker dockerタグが付けられた新着投稿 - Qiita 【Docker】Docker基本コマンド集 https://qiita.com/LingmuSajun/items/3b65cf236d97a60c2682 公式cd対象ディレクトリ例cdUsers名前Developlaravelsnslaradockコンテナ起動コンテナを指定して起動する。 2020-05-13 23:57:13
Docker dockerタグが付けられた新着投稿 - Qiita DockerとVueとNginxで動いたから残しておく。 https://qiita.com/TaitoAjiki/items/8c07c1d281c66ef22c60 BACKENDHOSTは、nginxからどこにアクセスするかを指定する。 2020-05-13 23:32:46
Ruby Railsタグが付けられた新着投稿 - Qiita sinatraとrailsで比較!ページが表示されるまでの流れ https://qiita.com/vain_vox/items/27b96fb3f208ec678814 sinatraとrailsで比較ページが表示されるまでの流れrailsとsinatraの表示までの流れを比較してみました。 2020-05-13 23:57:54
Ruby Railsタグが付けられた新着投稿 - Qiita マイグレーションファイルを修正する https://qiita.com/yuya_maru2/items/87df1377cbef733c7647 マイグレーションファイルを修正するdown状態のマイグレーションファイルのミスのあるところを修正します。 2020-05-13 23:54:51
Ruby Railsタグが付けられた新着投稿 - Qiita 新しく作成した.jsファイルが読み込まれない https://qiita.com/thikeshi777/items/d7cf98eb1c5eda78d346 新しく作成したjsファイルが読み込まれない新しく作成したjsファイルが読み込まれないjQueryで追加機能を新しいファイルに書き込み実装したところ、うまく起動しなかった。 2020-05-13 23:48:11
Ruby Railsタグが付けられた新着投稿 - Qiita aタグ href属性で、link_toと同じようにmethod指定する方法 https://qiita.com/777mountain/items/66504b1e2c6ce1e9ab8a aタグhref属性で、linktoと同じようにmethod指定する方法結論・aタグhref属性を使う際にも、例えばdatamethodgtdeleteと記述することでmethodVerbを指定でき、linktoのように柔軟なリンク設定ができます。 2020-05-13 23:35:39
Ruby Railsタグが付けられた新着投稿 - Qiita Day12 Rails コメント機能の実装 https://qiita.com/Seungbaek_Seo/items/61c7c49d01adf381e7be DayRailsコメント機能の実装コメントモデルの作成ⅰコメントモデル作成railsgmodelcommentⅱcommentsテーブルにカラム作成dbmigrateXXXXXXXXXXXXcreatecommentsrbcreatetablecommentsdottintegeruseriduseridカラム作成tintegertweetidtweetidカラム作成ttexttextコメント本文textカラム作成ttimestampsendrailsdbmigrateマイグレーションファイルを実行ⅲテーブル間のアソシエーションを定義appmodelscommentrbclassCommentltApplicationRecordbelongstotweettweetsテーブルとのアソシエーションbelongstouserusersテーブルとのアソシエーションendappmodelstweetrbclassTweetltApplicationRecordvalidatestextpresencetruebelongstouserhasmanycommentscommentsテーブルとのアソシエーションendappmodelsuserrbclassUserltApplicationRecorddevisedatabaseauthenticatableregisterablerecoverablerememberablevalidatablehasmanytweetshasmanycommentscommentsテーブルとのアソシエーションendルーティングの設定configroutesrbRailsapplicationroutesdrawdodeviseforusersroottotweetsindexresourcestweetsdoresourcescommentsonlycreateendresourcesusersonlyshowendPrefixVerbURIPatternControllerAction中略tweetcommentsPOSTtweetstweetidcommentsformatcommentscreate中略ネスト構造にすることで、tweetstweetidcommentsformattweetidのところにコメントと結びつくidを記述できる。 2020-05-13 23:34:50
Ruby Railsタグが付けられた新着投稿 - Qiita ローカルサーバーがすでに起動していると言われてrails sできない時の対処 https://qiita.com/daiki421/items/28d5871411132ba52af0 killsudokillltpidgt 2020-05-13 23:25:06
Ruby Railsタグが付けられた新着投稿 - Qiita 【Rails Error】No such table userと言われた https://qiita.com/facultyoflaw11/items/a33bf5be5984a75d407b 【RailsError】Nosuchtableuserと言われた【RailsError】Nosuchtableuserと言われたあるとき、Deviseを導入した時に、こんなエラーが出たterminalgtrailsdbmigrateAddDeviseToUsersmigratingchangetableusersrailsabortedStandardErrorAnerrorhasoccurredthisandalllatermigrationscanceledSQLiteSQLExceptionnosuchtableusersUserテーブルがないとおとはいえrailsgdeviseuserをしてもrailsgmodeluserをしても反応しないじゃないか無いからダメって言われて、じゃあ作ろうとしたら怒るってどんなツンデレよあれこれ調べていると、adddevisetouserrbclassAddDeviseToUsersltActiveRecordMigrationdefselfupchangetableusersdotDatabaseauthenticatabletstringemailnullfalsedefaultなんかこのコードの行目にchangetableってあるぞなんか怪しい。 2020-05-13 23:04:31
海外TECH DEV Community German Corona warning app GitHub repo got published https://dev.to/lschultebraucks/german-corona-warning-app-github-repo-got-published-3l71 German Corona warning app GitHub repo got publishedThe aim of the Corona warning app is to recognize and break through SARS CoV infection chains as quickly as possible Users should be reliably and quickly informed about encounters with infected users of the app and thus possible transmissions of the virus so that they can voluntarily isolate themselves in order to help contain the SARS CoV pandemic From the README The German government has asked SAP and Deutsche Telekom to develop the Corona Warn App for Germany as open source software Deutsche Telekom is providing the network and mobile technology and will operate and run the backend for the app in a safe scalable and stable manner SAP is responsible for the app development its framework and the underlying platform Therefore development teams of SAP and Deutsche Telekom are contributing to this project At the same time our commitment to open source means that we are enabling in fact encouraging all interested parties to contribute and become part of its developer community Code hasn t been published yet just the documentation As a german citizen its very interesting to me also because it is a controversial discussed topic What do you think of such apps Do you have similar projects in your countries 2020-05-13 14:29:14
海外TECH DEV Community Create a Video Party App With Rails Part 2: Building the Frontend https://dev.to/vonagedev/create-a-video-party-app-with-rails-part-2-building-the-frontend-hfe Create a Video Party App With Rails Part Building the FrontendThis is the second part of a two part series on creating a video watch party application using the Vonage Video API and Ruby on Rails In the first article we went through the steps of building the backend of the app If you have not read that post yet it would be a good place to start Now we are going to focus on the frontend of our application While the backend was written mainly in Ruby the frontend will be a lot of client side JavaScript Once we are done we will have a video watch party app that we can use to chat with our friends and watch videos together Let s get started tl dr If you would like to skip ahead and get right to deploying it you can find all the code for the app and a one click Deploy to Heroku button at the GitHub repository Table of ContentsWhat Will We Be BuildingCreating the JavaScript PacksStyling the ApplicationPutting It All TogetherWhat Will We Be BuildingBefore we start coding it is a good idea to take a moment and discuss what we will be building If you recall from the first post we had instantiated a Video API Session ID and are actively creating tokens for each participant That information is being passed to the frontend by newly created JavaScript variables in the ERB view files Additionally we are also passing data from our environment variables to the frontend We will be using all that information in the code we will write to create the experience of the app Ruby on Rails has come a long way in integrating client side JavaScript directly into the stack with the introduction of Webpack in Rails starting with version JavaScript is incorporated through packs placed inside app javascript packs and added as either import or require statements inside the application js file inside the directory We will be separating out the various concerns of our code into different files so that at the end your folder will have the following files app javascript packs application js app helpers js chat js opentok screenshare js opentok video js party js screenshare jsEach file besides application js will contain code to cover distinct concerns app helpers js Cross functional code that is needed across the frontendchat js Creating a Chat class that will be used to instantiate instances of the text chatopentok screenshare js The client side code for the Screenshare viewopentok video js The client side code for the Video Chat viewparty js Creating a Party class that will be used to instantiate instances of the video chatscreenshare js Creating a Screenshare class that will be used to instantiate instances of the screenshare functionalityPrior to creating the code let s add these files to the application js file which will instruct Webpack to compile them at runtime application jsimport app helpers js import opentok video js import opentok screenshare js Creating the JavaScript PacksIn each subsection we will create the JavaScript files that we enumerated above The app helpers js FileThe app helpers js file will contain generic helper functions that we will export to the rest of the code to use throughout the app We will create screenshareMode setButtonDisplay formatChatMsg and streamLayout functions The screenshareMode function will take advantage of the Vonage Video API Signal API to send a message to the browsers of all the participants that will trigger a window location change The Signal API is the same API we will use for the text chat which is its simplest use case However as we will see in this function the Signal API provides an intuitive and powerful way to direct the flow of your application simultaneously for all the participants without needing to write lots of code export function screenshareMode session mode if mode on window location screenshare name name session signal type screenshare data on else if mode off window location party name name session signal type screenshare data off The next function setButtonDisplay changes the style for the HTML element containing the Watch Mode On Off button to either be block or none depending on whether the participant is the moderator or not There are many other ways to do this including more secure methods However in order to keep things simple for this app to watch videos amongst friends we will keep the keep minimalist export function setButtonDisplay element if name moderator env name element style display block else element style display none The formatChatMsg function takes in the text message the participant sent as an argument and formats it for presentation on the site This function looks for any text bracketed by two colons and attempts to parse the text inside those colons as an emoji It also appends the participant s name to each message so everyone knows who is talking In order to add the emojis we need to install a node package called node emoji and we can do that by adding const emoji require node emoji to the top of the file and running yarn add node emoji in the command line The function will utilize match with a regular expression to search for strings of text bookmarked by two colons and if it matches it will invoke the emoji const we defined to turn that string into an emoji export function formatChatMsg message var message arr message arr message split map function word if word match b w b g return word emoji get word else return word message message arr join return name message The last function inside app helpers js we need to create is streamLayout that takes in arguments of the HTML element and the count of participants The function will add or remove CSS classes to the element depending on the number of participants in order to change the video chat presentation into a grid format export function streamLayout element count if count gt element classList add grid else if count element classList remove grid element classList add grid else if count lt element classList remove grid The chat js FileThe chat js code is going to create the Chat class using a constructor This Chat class will be called and instantiated in both the video chat and screenshare views chat jsimport formatChatMsg from app helpers js export default class Chat constructor session this session session this form document querySelector form this msgTxt document querySelector message this msgHistory document querySelector history this chatWindow document querySelector chat this showChatBtn document querySelector showChat this closeChatBtn document querySelector closeChat this setupEventListeners We have given several properties to Chat mostly based on different elemnts in the DOM and the Video API session The last one this setupEventListeners is invoking a function that we need to now add to the file setupEventListeners let self this this form addEventListener submit function event event preventDefault self session signal type msg data formatChatMsg self msgTxt value function error if error console log Error sending signal error name error message else self msgTxt value this session on signal msg function signalCallback event var msg document createElement p msg textContent event data msg className event from connectionId self session connection connectionId mine theirs self msgHistory appendChild msg msg scrollIntoView this showChatBtn addEventListener click function event self chatWindow classList add active this closeChatBtn addEventListener click function event self chatWindow classList remove active setupEventListeners creates an EventListener for the text chat submit button When a new message is submitted it is sent to the Signal API to be processed and sent to all the participants Similarly when a new message is received a new lt p gt tag is added to the chat element and the participant s text chat window is scrolled to view it The next two files we will create perform similar functionality in creating new classes for the video chat party and for the screenshare view The party js FileIn this file we will create the Party class that will be used to instantiate new instances of the video chat party jsimport screenshareMode setButtonDisplay streamLayout from app helpers js export default class Party constructor session this session session this watchLink document getElementById watch mode this subscribers document getElementById subscribers this participantCount document getElementById participant count this videoPublisher this setupVideoPublisher this clickStatus off this setupEventHandlers this connectionCount setButtonDisplay this watchLink The constructor function is given the Video API session as an argument and passes that to this session The rest of the properties are defined and given values The watchLink subscribers participantCount properties come from the HTML elements while videoPublisher is provided a function as its value and clickStatus is given default of off We will create the setupVideoPublisher function at this point The function invokes the Video API JavaScript SDK initPublisher function to start the video publishing It can take in optional arguments and as such we specify that the video should occupy of the width and height of its element and should be appended to the element setupVideoPublisher return OT initPublisher publisher insertMode append width height function error if error console error Failed to initialise publisher error There are several actions we also must create event listeners for and add them to the class We need to listen for when the session is connected when a video stream has been created when a connction has been added and when a connection has been destroyed When a connection has been added or destroyed we either increment or decrement the participant count and share the number of participants in the participant count lt div gt element on the page setupEventHandlers let self this this session on This function runs when session connect asynchronously completes sessionConnected function event Publish the publisher we initialzed earlier this will trigger streamCreated on other clients self session publish self videoPublisher function error if error console error Failed to publish error This function runs when another client publishes a stream eg session publish streamCreated function event Subscribe to the stream that caused this event and place it into the element with id subscribers self session subscribe event stream subscribers insertMode append width height function error if error console error Failed to subscribe error This function runs whenever a client connects to a session connectionCreated function event self connectionCount self participantCount textContent self connectionCount Participants streamLayout self subscribers self connectionCount This function runs whenever a client disconnects from the session connectionDestroyed function event self connectionCount self participantCount textContent self connectionCount Participants streamLayout self subscribers self connectionCount Lastly we add one more event listener This event listener is attached to the click action on the Watch Mode On Off button When it is clicked it goes to the screenshare view if the click status was off You will recall that the click status is given a default of off in the construction of the class this watchLink addEventListener click function event event preventDefault if self clickStatus off Go to screenshare view screenshareMode self session on The screenshare js FileThe final class we will create is a Screenshare class that will be responsible for defining the video screenshare The constructor function takes the Video API session and the participant s name as arguments screenshare jsimport screenshareMode from app helpers js export default class Screenshare constructor session name this session session this name name this watchLink document getElementById watch mode this clickStatus on Unlike the Party class the clickStatus here defaults to on since we want to move away from the screenshare and back to the video chat mode if the moderator clicks the Watch Mode On Off button We also utilize toggle to either share the participant s screen if the participant is the moderator or subscribe to the screenshare for everyone else toggle if this name moderator env name this shareScreen else this subscribe The shareScreen function invoked in the toggle needs to be defined shareScreen this setupPublisher this setupAudioPublisher this setupClickStatus This function itself has three functions that need to also be created The first function will publish the screen of the moderator However the screen publishing by itself does not also include audio Therefore a second function will publish the audio from the moderator s computer Then the final function in shareScreen will move back to the video chat view if the Watch Mode On Off button is clicked setupClickStatus screen share mode off if clicked off Set click status let self this this watchLink addEventListener click function event event preventDefault if self clickStatus on self clickStatus off screenshareMode self session off setupAudioPublisher var self this var audioPublishOptions audioPublishOptions insertMode append audioPublishOptions publishVideo false var audio publisher OT initPublisher audio audioPublishOptions function error if error console log error else self session publish audio publisher function error if error console log error setupPublisher var self this var publishOptions publishOptions videoSource screen publishOptions insertMode append publishOptions height publishOptions width var screen publisher OT initPublisher screenshare publishOptions function error if error console log error else self session publish screen publisher function error if error console log error All the above is in order to create the screenshare for the moderator Everyone else in the app will want to subscribe to that screenshare We will use the subscribe function to do that This will be the last function inside the file subscribe var self this this watchLink style display none this session on streamCreated function event console log event if event stream hasVideo true self session subscribe event stream screenshare insertMode append width height function error if error console error Failed to subscribe to video feed error else if event stream hasVideo false self session subscribe event stream audio insertMode append width px height px function error if error console error Failed to subscribe to audio feed error We are now ready to make all these classes we have defined work in the application by creating instances of them inside the opentok screenshare js and opentok video js files Creating opentok video jsThe opentok video js file will build a new video chat experience Most of the work was done in the classes we defined above so this file is relatively small First let s import the Chat and Party classes opentok video jsimport Chat from chat js import Party from party js Then we will define a global empty variable to hold the Video API session var session Then we wrap the rest of the code in three checks to make sure we are on the correct website path that the DOM is fully loaded and that the participant name is not empty if window location pathname party document addEventListener DOMContentLoaded function if name The rest of the code initiates a new Video API session if one does not exist and instantiates a new Chat and new Party At the end we also listen for the Signal API to send a screenshare data message with the value of on When that message is received the window location is moved to screenshare Initialize an OpenTok Session object if session session OT initSession api key session id new Chat session new Party session Connect to the Session using a token session connect token function error if error console error Failed to connect error Listen for Signal screenshare message session on signal screenshare function screenshareCallback event if event data on window location screenshare name name Creating opentok screenshare jsThe last JavaScript file we will create is mightily similar to the last one It is responsible for the screenshare view and leverages the Screenshare and Chat classes we defined earlier import Screenshare from screenshare js import Chat from chat js declare empty global session variablevar session if window location pathname screenshare document addEventListener DOMContentLoaded function Initialize an OpenTok Session object if session session OT initSession api key session id Hide or show watch party link based on participant if name amp amp window location pathname screenshare new Chat session new Screenshare session name toggle Connect to the Session using a token session connect token function error if error console error Failed to connect error Listen for Signal screenshare message session on signal screenshare function screenshareCallback event if event data off window location party name name Before we can wrap this up last but certainly not least we need to define the frontend style of the application All this code is useless if it is not accessible by the participants Styling the ApplicationThe stylesheet for this application would not have happened without the help of my friend and former colleague Hui Jing Chen who taught me a lot about front end design through this process The app primarily uses Flexbox Grid to order the elements Let s start by creating a custom css file inside app javascript stylesheets We want to make sure that it is included in our application so add an import line to application scss in the same folder import custom css First let s add the core styling in custom css root main a txt alt white txt black background white bgImage url images png chat bg rgba chat mine darkgreen chat theirs indigo html box sizing border box height before after box sizing inherit margin padding body height display flex flex direction column background color var background background image var bgImage overflow hidden main flex display flex position relative input font size inherit padding em border radius px border px solid currentColor button input type submit font size inherit padding em border background color var main color var txt alt border radius px header background color var main color var txt alt padding em height em display flex align items center justify content space between Then let s add the styling for the landing page landing margin auto text align center font size landing form display flex flex direction column margin auto position relative landing input landing p margin bottom em landing error color maroon position absolute bottom em width text align center We also want to add the styling for the text chat especially making sure that it stays in place and does not scroll the whole page as it progresses chat width display flex flex direction column height position fixed top left z index background color var chat bg transform translateX transition transform s ease chat active transform translateX chat header padding em box shadow px px rgba px px rgba display flex justify content space between btn chat height em width em border radius box shadow px px rgba px px rgba position fixed right em bottom em cursor pointer btn chat svg height em width em btn close height em width em background transparent border none cursor pointer btn close svg height em width em messages flex display flex flex direction column overflow y scroll padding em box shadow px px rgba px px rgba scrollbar color ccc transparent messages p margin bottom em mine color var chat mine theirs color var chat theirs chat form display flex padding em box shadow px px rgba px px rgba chat input type text flex border top left radius px border bottom left radius px background color var background color var txt min width chat input type submit border top right radius px border bottom right radius px Now let s create the styling for the video chat and screenshare elements videos flex display flex position relative subscriber grid display grid grid template columns repeat auto fit minmax em fr subscriber grid display grid grid template columns repeat auto fit minmax em fr subscriber screenshare width height display flex publisher position absolute width vmin height vmin min width em min height em align self flex end z index audio position absolute opacity z index audio display none dark background black chat mine lime chat theirs violet txt white Lastly we will add a media query that will keep the text chat in proportion on smaller screens media screen and min aspect ratio chat width min width em That s it The application both the backend and the frontend has been created We are now ready to put it all together Putting It All TogetherEven though the application is a combination of multiple programming languages namely Ruby and JavaScript with an intertwined backend and frontend it is relatively straightforward to run it This is because Rails allows us to seamlessly integrate it all together with one command From the command line you can execute bundle exec rails s and watch your Rails server start You will also see the following almost magical line in your console output the first time you run the app Webpacker Compiling In fact you will see that every time you make a change to any of your JavaScript or CSS packs That output tells you that Rails is using Webpack to compile and incorporate all of your packs into the application Once the Webpacker Compiling is done you will see a list of all your compiled packs Version webpack Time msBuilt at PM Asset Size Chunks Chunk Names js app helpers cd js KiB app helpers emitted immutable app helpers js app helpers cd js map KiB app helpers emitted dev app helpers js application dfeedbebca js KiB application emitted immutable application js application dfeedbebca js map KiB application emitted dev application js chat fcaaddfdf js KiB chat emitted immutable chat js chat fcaaddfdf js map KiB chat emitted dev chat js opentok screenshare bcbecabfabe js KiB opentok screenshare emitted immutable opentok screensharejs opentok screenshare bcbecabfabe js map KiB opentok screenshare emitted dev opentok screenshare js opentok video eddcbc js KiB opentok video emitted immutable opentok video js opentok video eddcbc js map KiB opentok video emitted dev opentok video js party fdcccdbbfcce js KiB party emitted immutable party js party fdcccdbbfcce js map KiB party emitted dev party js screenshare ceedca js KiB screenshare emitted immutable screenshare js screenshare ceedca js map KiB screenshare emitted dev screenshare manifest json KiB emitted The file names reflect that they have been compiled down but you can still see your pack names in there if you look closely like opentok screenshare party app helpers etc Running your application locally is great for testing with yourself but you probably would like to invite friends to participate with you You can create an externally accessible link to your application running locally using a tool like ngrok It gives an external URL for your local environment The Nexmo Developer Platform has a guide on getting up and running with ngrok that you can follow If you would like to just get up and running you can also deploy with one click this application from GitHub directly to Heroku Click on the button and within moments you will have a watch party app ready to be used and enjoyed I would love to hear what you built using the Vonage Video API Please join the conversation on our Community Slack and share your story 2020-05-13 14:08:08
Apple AppleInsider - Frontpage News Apple AirPods Pro drop to $228 on Amazon today https://appleinsider.com/articles/20/05/13/apple-airpods-pro-drop-to-228-on-amazon-today Apple AirPods Pro drop to on Amazon todayAmazon has issued a special in cart discount on Apple AirPods Pro dropping the cost to Or save a few bucks more and grab the wireless earphones for at AT amp T Find all the deals in this savings roundup 2020-05-13 14:47:52
Apple AppleInsider - Frontpage News Compared: Microsoft's Surface Book 3 versus Apple's iPad Pro https://appleinsider.com/articles/20/05/13/compared-microsofts-surface-book-3-versus-apples-ipad-pro Compared Microsoft x s Surface Book versus Apple x s iPad ProThe arrival of Microsoft s Surface Book has given mobile workers another option for a high performance notebook tablet hybrid but could potential buyers be better served by an iPad Pro 2020-05-13 14:20:08
海外TECH Engadget Dell’s modern design comes to the XPS 15 and revived XPS 17 https://www.engadget.com/dell-xps-17-xps-15-2020-140044664.html Dell s modern design comes to the XPS and revived XPS With each new generation we ve heaped praise on Dell for its well built XPS line of laptops and it seems hard to imagine how the company can keep improving the series This year the PC maker is continuing its war against bezels by slimming down th 2020-05-13 14:01:19
Cisco Cisco Blog Remote Teaching: Tips and Tools to Build Engagement https://blogs.cisco.com/education/remote-teaching-tips-and-tools-to-build-engagement Remote Teaching Tips and Tools to Build EngagementWhat does it mean to be a remote teacher Learn how Cisco Networking Academy is empowering educators in distance learning The post Remote Teaching Tips and Tools to Build Engagement appeared first on Cisco Blogs 2020-05-13 14:45:00
海外科学 NYT > Science Live Coronavirus News: Paul Manafort Is Released Over Virus Concerns https://www.nytimes.com/2020/05/13/us/coronavirus-updates.html Live Coronavirus News Paul Manafort Is Released Over Virus ConcernsMillions more U S residents left their homes this week according to an analysis of cellphone data Dr Anthony Fauci said reopening too soon risked a resurgence County fairs are moving online 2020-05-13 14:53:45
海外科学 NYT > Science Coronavirus World News: Live Updates on U.K., Europe, Asia and Latin America https://www.nytimes.com/2020/05/13/world/coronavirus-news.html Coronavirus World News Live Updates on U K Europe Asia and Latin AmericaGermany Austria and others begin opening borders with more expected in the coming days as Europe looks to restart travel Latin America is experiencing some of the world s worst outbreaks 2020-05-13 14:34:38
海外科学 NYT > Science Coronavirus Ravaged a Choir. But Isolation Helped Contain It. https://www.nytimes.com/2020/05/12/health/coronavirus-choir.html Coronavirus Ravaged a Choir But Isolation Helped Contain It One sick singer attended choir practice infecting others two of whom died A study released by the C D C shows that self isolation and tracing efforts helped contain the outbreak 2020-05-13 14:07:16
金融 RSS FILE - 日本証券業協会 株主コミュニティの統計情報・取扱状況 http://www.jsda.or.jp/shiryoshitsu/toukei/kabucommunity/index.html 株主コミュニティ 2020-05-13 15:30:00
海外ニュース Japan Times latest articles Las Vegas Sands folds on $10 billion Japan casino project https://www.japantimes.co.jp/news/2020/05/13/business/corporate-business/las-vegas-sands-folds-japan-casino/ numbers 2020-05-14 00:06:49
海外ニュース Japan Times latest articles Virus forcing rethink of Japanese way of business at Toyota, CEO says https://www.japantimes.co.jp/news/2020/05/13/business/corporate-business/coronavirus-akio-toyoda-toyota-japan/ Virus forcing rethink of Japanese way of business at Toyota CEO saysChanges in working style due to the pandemic may spur changes as companies are forced to re examine long entrenched business practices 2020-05-13 23:24:17
海外ニュース Japan Times latest articles Sumo wrestler Shobushi, 28, is sport’s first coronavirus death https://www.japantimes.co.jp/sports/2020/05/13/sumo/sumo-wrestler-shobushi-dies-coronavirus/ takadagawa 2020-05-13 23:09:19
海外ニュース Japan Times latest articles Premier League braced for TV losses as player protests mount https://www.japantimes.co.jp/sports/2020/05/13/soccer/premier-league-braced-tv-losses-player-protests-mount/ financial 2020-05-13 23:24:31
海外ニュース Japan Times latest articles Ready or not, NL may have to adjust to designated hitter this year https://www.japantimes.co.jp/sports/2020/05/13/baseball/mlb/ready-not-nl-may-adjust-designated-hitter-year/ sight 2020-05-13 23:12:33
ニュース BBC News - Home Coronavirus: Some return to work as lockdown eases slightly in England https://www.bbc.co.uk/news/uk-52642222 public 2020-05-13 14:40:19
ニュース BBC News - Home Coronavirus: Row over 'too slow' care home response https://www.bbc.co.uk/news/uk-politics-52606985 control 2020-05-13 14:26:36
ニュース BBC News - Home Belly Mujinga Covid death: Victoria station workers 'scared' https://www.bbc.co.uk/news/uk-england-london-52650110 colleagues 2020-05-13 14:15:33
ニュース BBC News - Home Coronavirus: Social distancing 'impossible' on London commute https://www.bbc.co.uk/news/uk-52645366 lockdown 2020-05-13 14:16:30
ニュース BBC News - Home Coronavirus: What's the risk on public transport? https://www.bbc.co.uk/news/health-51736185 operators 2020-05-13 14:50:43
LifeHuck ライフハッカー[日本版] 外出自粛で美容院に行けない! 襟足やヒゲを20段階で細かく整えられるバリカン https://www.lifehacker.jp/2020/05/amazon-braun-hige-trimmer.html 長さ 2020-05-13 23:30:00
北海道 北海道新聞 英、唾かけられた駅員死亡 コロナ感染自称の男を捜査 https://www.hokkaido-np.co.jp/article/420668/ 駅員 2020-05-13 23:46:00
北海道 北海道新聞 島根が駆け込み休業要請へ 解除直前、パチンコ以外初 https://www.hokkaido-np.co.jp/article/420667/ 駆け込み 2020-05-13 23:46:00
北海道 北海道新聞 NY株、一時200ドル超安 米経済の悪化警戒 https://www.hokkaido-np.co.jp/article/420665/ 警戒 2020-05-13 23:32:00
北海道 北海道新聞 道、休業支援金10万円追加 石狩管内除き要請緩和 https://www.hokkaido-np.co.jp/article/420663/ 石狩管内 2020-05-13 23:16:44

コメント

このブログの人気の投稿

投稿時間:2021-06-17 05:05:34 RSSフィード2021-06-17 05:00 分まとめ(1274件)

投稿時間:2021-06-20 02:06:12 RSSフィード2021-06-20 02:00 分まとめ(3871件)

投稿時間:2020-12-01 09:41:49 RSSフィード2020-12-01 09:00 分まとめ(69件)