Q&A
前提
AR.jsで動画を表示させるコードを書きました。
実現したいこと
動画は再生されるのですが、下記のコードでは16:9の比率で再生されます。
ですが私は縦画面で撮影した動画を縦画面で再生させたいです。
幅と高さを逆にしてみたんですが表示は16:9のままです。
<a-video>タグで動画の比率を調節しているようです。
該当のソースコード
<!doctype html> <html> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no, target-densityDpi=device-dpi" /> <script src="https://aframe.io/releases/1.0.4/aframe.min.js"></script> <script src="https://raw.githack.com/AR-js-org/AR.js/master/aframe/build/aframe-ar.js"></script> <script src="https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-detector.js"></script> <script src="https://raw.githack.com/AR-js-org/studio-backend/master/src/modules/marker/tools/gesture-handler.js"></script> </head> <body style="margin: 0; overflow: hidden;"> <a-scene vr-mode-ui="enabled: false" device-orientation-permission-ui="enabled: false" embedded gesture-detector > <span id="volume" style="display: none;" onclick="toggleMute();"> <svg id="unmuted" enable-background="new 0 0 448.046 448.046" viewBox="0 0 448.046 448.046" xmlns="http://www.w3.org/2000/svg"><path d="m358.967 1.614c-5.6-2.72-12.128-1.952-16.928 1.92l-155.648 124.512h-74.368c-17.664 0-32 14.336-32 32v128c0 17.664 14.336 32 32 32h74.368l155.616 124.512c2.912 2.304 6.464 3.488 10.016 3.488 2.336 0 4.704-.544 6.944-1.6 5.536-2.656 9.056-8.256 9.056-14.4v-416c0-6.144-3.52-11.744-9.056-14.432z"/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/><g/></svg> </span> <a-assets> <video id="vid" src="assets/asset.mp4" preload="auto" response-type="arraybuffer" loop crossorigin webkit-playsinline muted playsinline ></video> <audio src="videopath" autoplay></audio> </a-assets> <a-marker type="pattern" preset="custom" url="assets/marker.patt" videohandler smooth="true" smoothCount="10" smoothTolerance="0.01" smoothThreshold="5" raycaster="objects: .clickable" emitevents="true" cursor="fuse: false; rayOrigin: mouse;" id="markerA" > <a-video link="href: https://twitter.com/TwitterLifeline" animation-mixer="loop:repeat" src="#vid" width="2.6" height="1.4" position="0 0 0" rotation="270 0 0" play="true" class="clickable" gesture-handler ></a-video> </a-marker> <a-entity camera></a-entity> </a-scene> </section> </body> </html>
あなたの回答
tips
プレビュー