5

I would like to set up a javascript listener on an iframe youtube 360 video player that would capture the pan/tilt coordinates of the 360 panorama that is being rotated.

Does anyone know if this is possible or some documentation for an api of the youtube 360 player? I have not been able to find any myself.

blurfus
  • 13,485
  • 8
  • 55
  • 61
Rob M
  • 67
  • 1
  • 4
  • [Cardboard does it](https://support.google.com/youtube/answer/6239930?hl=en), but I'm not sure if it's exposed in the javascript api. If anything maybe the android youtube player, since to get tilt/pan info you'd need to grab it from the gyroscope sensors. – Andy Sep 10 '15 at 20:54

2 Answers2

2

The ability to read the pan/tilt coordinates isn't currently supported. There is no mention of 360 degree video players in the documentation. I filed a enhancement request for this feature.

Nate
  • 2,449
  • 3
  • 21
  • 29
0

I'm using the youtube api already to stream live VR :

https://developers.google.com/youtube/v3/live/docs/liveBroadcasts#contentDetails.projection

check the object Livebroadcast object : you can specify : "rectangular" or "360"

NodeJs Example :

var start_date = new Date(Date.now() + (1000 /*sec*/ * 1 /*min*/ * 1 /*hour*/ * 1 /*day*/ * 1))

var youtube_broadcasts_body = {
    snippet: {
        "scheduledStartTime": start_date,
        "title": "Live from StackOverflow"
    },
    status: {
        "privacyStatus": "unlisted"
    },
    contentDetails: {
        "projection": "360",  <-------- this is for VR default is "rectangular"
    }
}

var youtube_livebroadcast_params = {
    part: "id,snippet,status, contentDetails",
    resource: youtube_broadcasts_body
}

youtube.liveBroadcasts.insert(youtube_livebroadcast_params, callback) 
M. Gara
  • 1,023
  • 2
  • 14
  • 27