packages/embed-plugin-youtube/src/index.js
async function fetchDetails(id, fetch, gAuthKey) {
  try {
    const res = await fetch(
      `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${gAuthKey}&part=snippet,statistics`
    )
    const data = await res.json()
    return data.items[0]
  } catch (e) {
    console.log(e)
    return {}
  }
}
async function fetchDetails(id, fetch, gAuthKey) {
  try {
    const res = await fetch(
      `https://www.googleapis.com/youtube/v3/videos?id=${id}&key=${gAuthKey}&part=snippet,statistics`
    )
    const data = await res.json()
    return data.items[0]
  } catch (e) {
    console.log(e)
    return {}
  }
}
async function fetchDetails ( id , fetch , gAuthKey ) { try { const res = await fetch ( ` ${ id } ${ gAuthKey } ` ) const data = await res . json ( ) return data . items [ 0 ] } catch ( e ) { console . log ( e ) return { } } }
Fetch details of a particular youtube video
@param id
@param gAuthKey
@returns {Promise.<*>}
Fetch details of a particular youtube video