Skip to content

Posts

Revel入門

ちょっとしたWebアプリを作りたくなったので、GoでRailsみたいなフレームワークないのかなと探した。

が近そうだったので、試してみた。

$ go install github.com/revel/cmd/revel@latest
go: downloading github.com/revel/cmd v1.1.2
go: downloading github.com/agtorre/gocolorize v1.0.0
go: downloading github.com/jessevdk/go-flags v1.4.0
go: downloading github.com/revel/config v1.1.0
go: downloading github.com/revel/log15 v2.11.20+incompatible
go: downloading github.com/mattn/go-colorable v0.1.8
go: downloading gopkg.in/natefinch/lumberjack.v2 v2.0.0
go: downloading gopkg.in/stack.v0 v0.0.0-20141108040640-9b43fcefddd0
go: downloading github.com/pkg/errors v0.9.1
go: downloading github.com/fsnotify/fsnotify v1.4.9
go: downloading github.com/mattn/go-isatty v0.0.14
go: downloading github.com/inconshreveable/log15 v0.0.0-20201112154412-8562bdadbbac
$ revel new -a events_go -r
revel: command not found

おや?パスが通ってない?

Read more

Amazon IVSプライベートチャネル

ストリームの再生にトークンが必要になる。

ほぼこのブログのやり方でできた。

一点だけ、秘密鍵を Secrets Manager にアップロードのところでエラーになった。 cliのバージョンが変わって、コマンドに--cli-binary-format raw-in-base64-outオプションを指定する必要があるとのこと。

Read more

Amazon IVS+Amplify

IVSのサンプルアプリ(React製)をAmplifyにデプロイしてみた。

npm run buildしたbuildディレクトリを丸ごとアップロードで。

jsとcssがHTTPコード301でファイル名の最後に/をつけたアドレスにリダイレクトされてエラーになっていたので、書き換えないようリダイレクト設定をしたら動いた。

IVSのストリーミングもOBSから送信できた。

Read more

Amazon IVSのエラー

IVSのチャットルームがエラーで作れない件、試しにもう一つアカウント作ってみたけれど、同じ現象だった。

2年前に作ったアカウントと何が違うのだろう。。

Amazon IVSのサンプル

相変わらずエラーでIVSのチャットルームが作れない

Your account is pending verification. Until the verification process is complete, you may not be able to carry out requests with this account. If you have questions, contact AWS Support.

仕方ないので、作れる方のアカウントで動作確認を進めることにした。

前に試したのと同じように、ap-northeast-1 でS3バケット作ってsam deployして、IVSチャットルームはus-east-1にした。 Waiting to connect...でつながらない。

Read more

Image Cropper

hnvn/flutter_image_cropper: A Flutter plugin for Android and iOS supports cropping imagesを使うときにエラーが出ていた件、解決。

Flutter Webで使うときはweb/index.htmlにcssとjsを追加するようにREADMEに書かれていた。

ドキュメントはちゃんと読まないと、かえって時間を浪費してしまう例だ。

ただ、スマホのブラウザで表示したときにはみ出してしまうので、この辺は要調査。

Read more

FlutterでCORS

crop使うために、–web-rendererをcanvaskitにしたら、Firebase Storageの画像を表示できなくなってしまった。

Displaying images on the web | Flutterにも書かれていて、いくつか回避策が提示されていた。

Firebase Hostingはfirebase.jsonで設定できるらしいが、今回問題になっているのはStorageの方で。

Read more

Amazon IVSのサンプルを試してみた

aws-samples/amazon-ivs-chat-web-demo: A demo web application that shows how to implement a basic video + chat application using the AWS serverless application model (SAM) and Javascript (React).

これを試すにあたり、作ったものをまるごと削除できるようにAWS Organizationsで専用アカウント作成した。 ついでにAWS Single Sign-Onも設定してログインを集中管理できるようにした。

CloudShellで作業する。

$ git clone https://github.com/aws-samples/amazon-ivs-chat-web-demo.git
$ cd amazon-ivs-chat-web-demo/serverless/dependencies/nodejs
$ npm install
$ cd ../../
$ aws s3api create-bucket --bucket ivstestumemakhome123 --region ap-northeast-1 \
--create-bucket-configuration LocationConstraint=ap-northeast-1
$ sam package --template-file template.yaml \
  --s3-bucket ivstestumemakhome123 \
  --output-template-file output.yaml
$ sam deploy --template-file ./output.yaml \
--stack-name ivstest \
--capabilities CAPABILITY_IAM \
--region ap-northeast-1
$ cd ../web-ui/
$ vim src/config.js

CHAT_ROOM_IDを取得するために、コンソールからチャットルームを作成しようとしたら東京リージョンでは選択できなかった。 us-east-1(バージニア北部)にした。

Read more

Flutterの状態管理

画像の選択前後で表示だし分けしたい件、Prvider使って実装してたけど、setStateで良いことに気づいた。

だいぶFlutterのことがわかってきた気がする。

(cropはまだできていない)