2

Is it possible to play youtube videos without the IFRAME and player?

I would like to be able to play the video on a video texture.

You see show I have done it here:

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

This is the code that will play my own 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>

I would like to be able to play a video that comes from youtube.

JW player seem to be able to play youtube video's

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

is it possible and what are my options? Do youtube offer any kind of paid for service for additional features?

H. Pauwelyn
  • 13,575
  • 26
  • 81
  • 144
garyconstable
  • 309
  • 3
  • 15
  • 2
    Please see http://stackoverflow.com/questions/36298195/how-to-render-youtube-videos-as-a-texture-in-a-frame – Utopiah Sep 12 '16 at 10:57

1 Answers1

0

Better forget any player for this job.

Note :

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

Reasons:

  • youtube.com will not accept cross domain on there servers.

You will need to add server part for you web app. I use nodejs.

This is procedure:


  ----> 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.

Now you can do what ever you want.

Direct demo link: https://maximumroulette.com:3000

Full solution at: https://github.com/zlatnaspirala/vue-typescript-starter

Nikola Lukic
  • 4,001
  • 6
  • 44
  • 75