2017-03-20 130 views
-1

我想顯示A幀本地視頻,並在同一臺計算機上。但是,在瀏覽器上,沒有任何顯示,屏幕是黑色的(似乎沒有渲染)。 我只是對360視頻源代碼做了一點改動,而我是較新的Web開發人員。所以請幫助我,告訴我我的錯在哪裏。 我的源代碼是那些:A幀本地視頻無法顯示

<!DOCTYPE html> 
<html> 
<head> 
     <meta charset="utf-8"> 
     <title>360 Video</title> 
     <meta name="description" content="360 Video — A-Frame"> 
     <script src="../../../dist/aframe-master.js"></script> 
</head> 
<body> 
    <a-scene> 
    <a-assets> 
     <!-- tt.mp4 is my video file and with index.html at the same folder --> 
     <video id="video" src="tt.mp4" autoplay loop crossorigin></video> 
    </a-assets> 

    <a-videosphere src="#video" rotation="0 180 0"></a-videosphere> 
</a-scene> 

回答

0

它在本地做是困難的,因爲(儘管crossorigin屬性),您的瀏覽器可能不容許參考。我會建議使用包含<?php include_once("[your-aframe-file].html"); ?>index.php文件啓動本地php服務器。這樣你的php服務器被認爲是一個單一的來源。如果您使用的是正在運行的MacOS或Linux,我知道命令行命令只是項目目錄中的php -S localhost:8000