mwkwsd / sensensomething

3 stars 0 forks source link

Create function to get videoProvider and VideoId from embedUrl #105

Closed ChuckBTaylor closed 3 months ago

ChuckBTaylor commented 4 months ago

Can we get a function that looks like this?

type VideoProvider = 'youtube' | 'vimeo'

/**
* Accepts url from IVideoData as an arg and returns a tuple of the VideoProvider and the Id
*/
function getVideoProviderAndId(videoEmbedUrl: string): [VideoProvider, string] {
  // your code here

  return [videoProvider, videoId]
}
ChuckBTaylor commented 3 months ago

Thanks!