もくじ
動作確認 2018-0918
- Chrome ◎
- IE ◎
- Firefox ×
- Android標準ブラウザ ◎
注意
- httpsでの動作環境が必要
CORS設定 NginxServerディレクティブ内
storage.googleapis.comからのアクセスを受け入れる
# Google VR View add_header Access-Control-Allow-Origin https://storage.googleapis.com always; add_header Access-Control-Allow-Methods "POST, GET, OPTIONS"; add_header Access-Control-Allow-Headers "Origin, Authorization, Accept"; add_header Access-Control-Allow-Credentials true;
全部おっけー版
# Google VR View add_header Access-Control-Allow-Origin * always; add_header Access-Control-Allow-Methods "POST, GET, OPTIONS"; add_header Access-Control-Allow-Headers "Origin, Authorization, Accept"; add_header Access-Control-Allow-Credentials true;
スクリプト読み込み
<!--Google VR View--> <script src="//storage.googleapis.com/vrview/2.0/build/vrview.min.js"></script> <script> window.addEventListener('load', onVrViewLoad) function onVrViewLoad() { var vrView = new VRView.Player('#vrview', { image: 'https://www.yuulinux.tokyo/demo/4837-GoogleVR-v1/vr-image1.jpg', //画像を埋め込みたい場合。値にパスを指定。 width: '100%', height: '100%', is_autopan_off: true, }); } </script> <!--Google VR View END-->
index.php
<div id="vrview" align=center></div>
@image
- https://thinkmobiles.com/blog/how-to-make-react-vr-app/