diff --git a/src/App.ts b/src/App.ts index d12987b..6729673 100644 --- a/src/App.ts +++ b/src/App.ts @@ -172,3 +172,19 @@ export default class App extends Vue this.$refs.ps.show(this.swipeItems(), {index: index}); } } + +/** + * Get VID from youtube url + * + * @param url + */ +function getYoutubeVID(url: string) +{ + let video_id = url.split('v=')[1]; + let ampersandPosition = video_id.indexOf('&'); + if(ampersandPosition != -1) + { + video_id = video_id.substring(0, ampersandPosition); + } + return video_id; +}