2

是否可以在没有 IFRAME 和播放器的情况下播放 youtube 视频?

我希望能够在视频纹理上播放视频。

你看我已经在这里完成了:

http://dev3.garyconstable.co.uk/

这是播放我自己的mp4的代码

<a-scene>
  <a-assets>
    <video id="video" autobuffer height="240" width="360" autoplay loop="true" crossorigin="anonymous" webkit-playsinline>
      <source src="media/videos_s_7.mp4">
    </video>
  </a-assets>
  <a-videosphere id="vid-sphere"  autopla="true"></a-videosphere>
</a-scene>

我希望能够播放来自 youtube 的视频。

JW 播放器似乎可以播放 youtube 视频

https://support.jwplayer.com/customer/portal/articles/1406725-youtube-video-embed

有可能吗?我有什么选择?youtube 是否为附加功能提供任何类型的付费服务?

4

1 回答 1

0

最好忘记这个工作的任何球员。

笔记 :

JW Player uses the official iFrame player API from YouTube to play a video inside of JW Player. 

原因:

  • youtube.com 将不接受那里的服务器上的跨域。

您将需要为您的 Web 应用程序添加服务器部分。我使用nodejs。

这是程序:


  ----> Use classic google , youtube APi login/search
  ----> Make search and collect search result data (Most important is `videoId` )
  ----> Save to your own server 
  ----> Call from web app your new route.

现在你可以做任何你想做的事。

直接演示链接: https ://maximumroulette.com:3000

完整解决方案: https ://github.com/zlatnaspirala/vue-typescript-starter

于 2020-08-02T21:30:19.660 回答