{"id":28274,"date":"2022-03-23T22:24:21","date_gmt":"2022-03-23T22:24:21","guid":{"rendered":"http:\/\/How-to-add-a-YouTube-Video-Player-in-Angular"},"modified":"2025-02-15T14:39:17","modified_gmt":"2025-02-15T22:39:17","slug":"how-to-add-a-youtube-video-player-in-angular","status":"publish","type":"post","link":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/","title":{"rendered":"How to add a YouTube Video Player"},"content":{"rendered":"<div class=\"wp-block-cloudinary-markdown \"><p>YouTube is, without any doubt, one of the most popular websites for video-sharing today. It\u2019s really easy to upload any video format and share it with your friends. Also, the YouTube team provides an <a href=\"https:\/\/developers.google.com\/youtube\/iframe_api_reference\">API Reference<\/a> to let you embed a YouTube video on any website and, of course, control it using JavaScript.<\/p>\n<p>Some time ago, I started working on a web application using the <a href=\"https:\/\/angular.io\/\">Angular<\/a> framework, and one of the main features involved the use of an embedded YouTube video player to avoid the user\u2019s context switching, or opening a separate browser to see a video. At that time, there was no native solution to solve this problem like there is today.<\/p>\n<p>In this <em>MediaJam<\/em> we\u2019ll leverage a TypeScript-oriented solution, using the latest Angular version, to build a small web application, and embed a YouTube video player. One of the standout features of the Angular YouTube Player is its ease of use, ensuring a straightforward integration process for developers.<\/p>\n<h2>Prerequisites<\/h2>\n<p>You\u2019ll need to have installed the following tools in your local environment:<\/p>\n<ul>\n<li>The latest LTS version of <a href=\"https:\/\/nodejs.org\/en\/about\/releases\/\">Node.js<\/a> available is recommended.<\/li>\n<li>Either NPM or Yarn as a package manager.<\/li>\n<li>The <a href=\"https:\/\/cli.angular.io\/\">Angular CLI<\/a> tool (Command-line interface for Angular).<\/li>\n<\/ul>\n<h2>Initialize the Project<\/h2>\n<p>Let\u2019s create a small project from scratch using the <a href=\"https:\/\/cli.angular.io\/\">Angular CLI<\/a> tool.<\/p>\n<p>First, you can create the folder using <code>mkdir angular-youtube-player-demo<\/code>.<\/p>\n<p>Then, enter the newly created folder, and run the <code>ng new<\/code> tool following the below syntax:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-1\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\">ng new <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">project-name<\/span>&gt;<\/span> &#91;options]\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-1\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The <code>ng new<\/code> command will take the <code>project-name<\/code> as an input to have an application ready following best practices. In this case, let\u2019s use the directory we just created above.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-2\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\">cd angular-youtube-player-demo\nng <span class=\"hljs-keyword\">new<\/span> angular-youtube-player-demo --directory .\/ --routing --prefix corp --style css --minimal\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-2\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>This command will initialize a base project, using some configuration options:<\/p>\n<ul>\n<li>\n<code>angular-youtube-player-demo<\/code>. Sets the name of the Angular project.<\/li>\n<li>\n<code>--directory .\/<\/code>. Sets the directory to generate the files.<\/li>\n<li>\n<code>--routing<\/code>. Creates a routing module.<\/li>\n<li>\n<code>--prefix corp<\/code>. Defines a prefix to be applied to the selectors for created components(<code>corp<\/code> in this case). The default value is <code>app<\/code>.<\/li>\n<li>\n<code>--style css<\/code>. The file extension for the styling files.<\/li>\n<li>\n<code>--minimal<\/code>. Creates the project without any testing framework. Useful when you\u2019re working on a proof-of-concept project, for example.<\/li>\n<\/ul>\n<p>The output of the previous command will be as follows.<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">CREATE README.md (1033 bytes)\nCREATE .gitignore (631 bytes)\nCREATE angular.json (3163 bytes)\nCREATE package.json (775 bytes)\nCREATE tsconfig.json (538 bytes)\nCREATE .browserslistrc (703 bytes)\nCREATE tsconfig.app.json (287 bytes)\nCREATE src\/favicon.ico (948 bytes)\nCREATE src\/index.html (312 bytes)\nCREATE src\/main.ts (372 bytes)\nCREATE src\/polyfills.ts (2830 bytes)\nCREATE src\/styles.css (80 bytes)\nCREATE src\/assets\/.gitkeep (0 bytes)\nCREATE src\/environments\/environment.prod.ts (51 bytes)\nCREATE src\/environments\/environment.ts (662 bytes)\nCREATE src\/app\/app-routing.module.ts (245 bytes)\nCREATE src\/app\/app.module.ts (393 bytes)\nCREATE src\/app\/app.component.ts (1503 bytes)\n\u2714 Packages installed successfully.\n<\/code><\/span><\/pre>\n<p>If you pay attention to the generated files and directories, you\u2019ll see a minimal project structure for the source code too:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">|- src\/\n    |- app\/\n        |- app.module.ts\n        |- app-routing.module.ts\n        |- app.component.ts\n<\/code><\/span><\/pre>\n<h2>Video Player Implementation<\/h2>\n<h3>Install the YouTube Player Package<\/h3>\n<p>Before embedding any video in our application, install the <code>@angular\/youtube-player<\/code> package.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-3\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-tag\">npm<\/span> <span class=\"hljs-selector-tag\">install<\/span> <span class=\"hljs-selector-tag\">--save<\/span> <span class=\"hljs-keyword\">@angular<\/span>\/youtube-player\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-3\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>If you use Yarn, instead run<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-4\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-tag\">yarn<\/span> <span class=\"hljs-selector-tag\">add<\/span> <span class=\"hljs-keyword\">@angular<\/span>\/youtube-player\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-4\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3>Import the YouTubePlayer Module<\/h3>\n<p>Open the <code>app.module.ts<\/code> file and import the <code>YouTubePlayerModule<\/code><\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-5\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-comment\">\/\/ ... other imports<\/span>\n<span class=\"hljs-keyword\">import<\/span> {YouTubePlayerModule} <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'@angular\/youtube-player'<\/span>;\n\n@NgModule({\n  <span class=\"hljs-attr\">declarations<\/span>: &#91;\n    <span class=\"hljs-comment\">\/\/...<\/span>\n  ],\n  <span class=\"hljs-attr\">imports<\/span>: &#91;\n    BrowserModule,\n    AppRoutingModule,\n    YouTubePlayerModule\n  ],\n  <span class=\"hljs-attr\">providers<\/span>: &#91;],\n  <span class=\"hljs-attr\">bootstrap<\/span>: &#91;AppComponent]\n})\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">AppModule<\/span> <\/span>{ }\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-5\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>This can be done in a separate module if that\u2019s the case in your implementation.<\/p>\n<p>It\u2019s worth noting that the Angular YouTube Player doesn\u2019t just make embedding videos simpler; it also brings a plethora of customization options. Whether it\u2019s adjusting the player\u2019s appearance, tweaking its controls, or changing its size, the component provides the tools for fine-grained control over how the player behaves and looks.<\/p>\n<h3>Define the Data Model<\/h3>\n<p>Let\u2019s define the data model by creating a new file in <code>app\/model<\/code> folder. We can use the Angular CLI tool for that:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">ng generate interface model\/video\nCREATE src\/app\/model\/video.ts (28 bytes)\n<\/code><\/span><\/pre>\n<p>Then, open the brand new file <code>video.ts<\/code> in your editor, and set the model using a TypeScript interface.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-6\" data-shcb-language-name=\"CSS\" data-shcb-language-slug=\"css\"><span><code class=\"hljs language-css shcb-wrap-lines\"><span class=\"hljs-selector-tag\">export<\/span> <span class=\"hljs-selector-tag\">interface<\/span> <span class=\"hljs-selector-tag\">Video<\/span> {\n    <span class=\"hljs-attribute\">title<\/span>: string;\n    <span class=\"hljs-attribute\">link<\/span>: string;\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-6\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">CSS<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">css<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3>Create the Video Player Component<\/h3>\n<p>Let\u2019s create the <code>video-player<\/code> component, again, using the Angular CLI tool:<\/p>\n<pre class=\"js-syntax-highlighted\"><span><code class=\"hljs shcb-wrap-lines\">ng generate component video-player\nCREATE src\/app\/video-player\/video-player.component.ts (283 bytes)\nUPDATE src\/app\/app.module.ts (497 bytes)\n<\/code><\/span><\/pre>\n<p>Now, open the <code>video-player.component.ts<\/code> file, and add the following TypeScript code:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-7\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">VideoPlayerComponent<\/span> <span class=\"hljs-title\">implements<\/span> <span class=\"hljs-title\">OnInit<\/span> <\/span>{\n  private apiLoaded = <span class=\"hljs-literal\">false<\/span>;\n\n  @Input() videoId: string;\n\n  <span class=\"hljs-keyword\">constructor<\/span>() { }\n\n  ngOnInit(): <span class=\"hljs-keyword\">void<\/span> {\n    <span class=\"hljs-keyword\">if<\/span>(!<span class=\"hljs-keyword\">this<\/span>.apiLoaded) {\n      <span class=\"hljs-keyword\">const<\/span> tag = <span class=\"hljs-built_in\">document<\/span>.createElement(<span class=\"hljs-string\">'script'<\/span>);\n      tag.src = <span class=\"hljs-string\">'https:\/\/www.youtube.com\/iframe_api'<\/span>;\n      <span class=\"hljs-built_in\">document<\/span>.body.appendChild(tag);\n      <span class=\"hljs-keyword\">this<\/span>.apiLoaded = <span class=\"hljs-literal\">true<\/span>;\n    }\n  }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-7\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The <code>ngOnInit()<\/code> function is part of the component lifecycle, and it will be called once the data property(<code>videoId<\/code>) has been initialized.<\/p>\n<p>Since the <code>@angular\/youtube-player<\/code> package defines a component wrapper based on the <a href=\"https:\/\/developers.google.com\/youtube\/iframe_api_reference\">YouTube player API<\/a>, it needs to load the <em>IFrame Player<\/em> asynchronously.<\/p>\n<p>The method used in the previous code snippet access the DOM, and download the API code through the <code>&lt;script&gt;<\/code> tag. It would be something like this:<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-8\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">script<\/span> <span class=\"hljs-attr\">src<\/span>=<span class=\"hljs-string\">\"https:\/\/www.youtube.com\/iframe_api\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">script<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-8\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Next, define the template along with the <em>Property binding<\/em> through <code>videoId<\/code> as follows.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-9\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">youtube-player<\/span> &#91;<span class=\"hljs-attr\">videoId<\/span>]=<span class=\"hljs-string\">\"videoId\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">youtube-player<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-9\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<h3>Using the Video Player Component<\/h3>\n<p>Let\u2019s create a couple of video entries to be rendered through the Video Player Component we just created.<\/p>\n<p>Open the <code>app.component.ts<\/code> file, and set a <code>videoList<\/code> attribute.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-10\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-comment\">\/\/ ... other imports<\/span>\n<span class=\"hljs-keyword\">import<\/span> { Video } <span class=\"hljs-keyword\">from<\/span> <span class=\"hljs-string\">'.\/model\/video'<\/span>;\n\n<span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">AppComponent<\/span> <\/span>{\n  <span class=\"hljs-attr\">videoList<\/span>: Video&#91;] = &#91;\n    {\n      <span class=\"hljs-attr\">title<\/span>: <span class=\"hljs-string\">'&#91;Debugging] Expression has changed after it was checked'<\/span>,\n      <span class=\"hljs-attr\">link<\/span>: <span class=\"hljs-string\">'https:\/\/www.youtube.com\/watch?v=O47uUnJjbJc'<\/span>\n    },\n    {\n      <span class=\"hljs-attr\">title<\/span>: <span class=\"hljs-string\">'&#91;Debugging] The pipe {name} could not be found'<\/span>,\n      <span class=\"hljs-attr\">link<\/span>: <span class=\"hljs-string\">'https:\/\/www.youtube.com\/watch?v=maI2u6Sxk9M'<\/span>\n    }\n  ];\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-10\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>The <code>videoList<\/code> attribute contains a set of <code>Video<\/code> objects with the title and URL.<\/p>\n<p>Next, let\u2019s render a list of videos, and use the <code>&lt;corp-video-player&gt;<\/code> component. Open the <code>app.component.ts<\/code> file, and update the <code>template<\/code> section.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-11\" data-shcb-language-name=\"HTML, XML\" data-shcb-language-slug=\"xml\"><span><code class=\"hljs language-xml shcb-wrap-lines\"><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">div<\/span> <span class=\"hljs-attr\">style<\/span>=<span class=\"hljs-string\">\"text-align:center\"<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n    Angular YouTube Video Player Demo\n  <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h1<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">div<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span>Select a Video<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">ul<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">li<\/span> *<span class=\"hljs-attr\">ngFor<\/span>=<span class=\"hljs-string\">\"let video of videoList\"<\/span>&gt;<\/span>\n    <span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">h2<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">a<\/span> <span class=\"hljs-attr\">href<\/span>=<span class=\"hljs-string\">\"#\"<\/span> (<span class=\"hljs-attr\">click<\/span>)=<span class=\"hljs-string\">\"selectVideo(video)\"<\/span>&gt;<\/span>{{video.title}}<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">a<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">h2<\/span>&gt;<\/span>\n  <span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">li<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">ul<\/span>&gt;<\/span>\n<span class=\"hljs-tag\">&lt;<span class=\"hljs-name\">corp-video-player<\/span> &#91;<span class=\"hljs-attr\">videoId<\/span>]=<span class=\"hljs-string\">\"currentVideoId\"<\/span>&gt;<\/span><span class=\"hljs-tag\">&lt;\/<span class=\"hljs-name\">corp-video-player<\/span>&gt;<\/span>\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-11\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">HTML, XML<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">xml<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>As you can see, there are two bindings here: An <em>Event binding<\/em>(<code>(click)=&quot;selectVideo(video)&quot;<\/code>) and a <em>Property Binding<\/em>(<code>[videoId]=&quot;currentVideoId&quot;<\/code>). Let\u2019s define both of them to have the final code in the <code>app.component.ts<\/code> file.<\/p>\n<pre class=\"js-syntax-highlighted\" aria-describedby=\"shcb-language-12\" data-shcb-language-name=\"JavaScript\" data-shcb-language-slug=\"javascript\"><span><code class=\"hljs language-javascript shcb-wrap-lines\"><span class=\"hljs-keyword\">export<\/span> <span class=\"hljs-class\"><span class=\"hljs-keyword\">class<\/span> <span class=\"hljs-title\">AppComponent<\/span> <\/span>{\n  <span class=\"hljs-attr\">videoList<\/span>: Video&#91;] = &#91;\n    <span class=\"hljs-comment\">\/\/ Objects defined above<\/span>\n  ];\n\n  currentVideoId: string;\n\n  selectVideo(video: Video) {\n    <span class=\"hljs-keyword\">const<\/span> params = <span class=\"hljs-keyword\">new<\/span> URL(video.link).searchParams;\n    <span class=\"hljs-keyword\">this<\/span>.currentVideoId = params.get(<span class=\"hljs-string\">'v'<\/span>);\n  }\n}\n<\/code><\/span><small class=\"shcb-language\" id=\"shcb-language-12\"><span class=\"shcb-language__label\">Code language:<\/span> <span class=\"shcb-language__name\">JavaScript<\/span> <span class=\"shcb-language__paren\">(<\/span><span class=\"shcb-language__slug\">javascript<\/span><span class=\"shcb-language__paren\">)<\/span><\/small><\/pre>\n<p>Pay attention to the <code>selectVideo()<\/code> function implementation, since it \u201cextracts\u201d the video identifier from a URL object. Then, the <em>Id<\/em> value is assigned to the <code>currentVideoId<\/code> property.<\/p>\n<p>Every time the <code>currentVideoId<\/code> gets changed, the <code>&lt;corp-video-player&gt;<\/code> will be updated because of the <em>Property binding<\/em>.<\/p>\n<h2>The YouTube Video Player API<\/h2>\n<h3>Properties<\/h3>\n<figure class=\"table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name<\/th>\n<th>Description<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>@Input() videoId: string<\/code><\/td>\n<td>The YouTube video identifier to be rendered<\/td>\n<\/tr>\n<tr>\n<td><code>@Input() width: number<\/code><\/td>\n<td>The width of the video player<\/td>\n<\/tr>\n<tr>\n<td><code>@Input() height: number<\/code><\/td>\n<td>The height of the video player<\/td>\n<\/tr>\n<tr>\n<td><code>@Input() startSeconds: number<\/code><\/td>\n<td>The moment when the player is supposed to start playing<\/td>\n<\/tr>\n<tr>\n<td><code>@Input() endSeconds: number<\/code><\/td>\n<td>The moment when the player is supposed to stop playing<\/td>\n<\/tr>\n<tr>\n<td><code>@Input() suggestedQuality: YT.SuggestedVideoQuality<\/code><\/td>\n<td>The suggested quality of the player<\/td>\n<\/tr>\n<tr>\n<td><code>@Input() playerVars: YT.PlayerVars<\/code><\/td>\n<td>Extra parameters used to configure the player. See <a href=\"https:\/\/developers.google.com\/youtube\/player_parameters.html?playerVersion=HTML5#Parameters\">here<\/a><\/td>\n<\/tr>\n<tr>\n<td><code>@Input() showBeforeIframeApiLoads: boolean<\/code><\/td>\n<td>Whether the iFrame will attempt to load regardless of the status of the API on the page.<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n<h3>Events<\/h3>\n<figure class=\"table-wrapper\"><table>\n<thead>\n<tr>\n<th>Name<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td><code>@Output() ready: Observable&lt;YT.PlayerEvent&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>@Output() stateChange: Observable&lt;YT.OnStateChangeEvent&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>@Output() error: Observable&lt;YT.OnErrorEvent&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>@Output() apiChange: Observable&lt;YT.PlayerEvent&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>@Output() playbackQualityChange: Observable&lt;YT.OnPlaybackQualityChangeEvent&gt;<\/code><\/td>\n<\/tr>\n<tr>\n<td><code>@Output() playbackRateChange: Observable&lt;YT.OnPlaybackRateChangeEvent&gt;<\/code><\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n<p>Learn more about the available properties and events <a href=\"https:\/\/github.com\/angular\/components\/blob\/master\/src\/youtube-player\/youtube-player.ts\">here<\/a>.<\/p>\n<h2>Live Demo<\/h2>\n<p>Find the source code available in <a href=\"https:\/\/github.com\/luixaviles\/angular-youtube-player-demo\">GitHub<\/a>.<\/p>\n<p>If you prefer, you can play around with the project in <a href=\"https:\/\/codesandbox.io\/s\/angular-youtube-player-demo-niscx\">CodeSandbox<\/a> too:<\/p>\n<iframe src=\"https:\/\/codesandbox.io\/embed\/angular-youtube-player-demo-niscx?fontsize=14&#038;hidenavigation=1&#038;theme=dark\"\n     style=\"width:100%; height:500px; border:0; border-radius: 4px; overflow:hidden;\"\n     title=\"Angular YouTube Player Demo\"\n     allow=\"accelerometer; ambient-light-sensor; camera; encrypted-media; geolocation; gyroscope; hid; microphone; midi; payment; usb; vr; xr-spatial-tracking\"\n     sandbox=\"allow-forms allow-modals allow-popups allow-presentation allow-same-origin allow-scripts\"\n   ><\/iframe>\n<p>Feel free to reach out on <a href=\"https:\/\/twitter.com\/luixaviles\">Twitter<\/a> if you have any questions. Follow me on <a href=\"https:\/\/github.com\/luixaviles\">GitHub<\/a> to see more about my work.<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":41,"featured_media":28275,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_cloudinary_featured_overwrite":false,"footnotes":""},"categories":[1],"tags":[391,134,382,371,303],"class_list":["post-28274","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized","tag-angular","tag-guest-post","tag-player-video","tag-under-review","tag-video"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.6 (Yoast SEO v26.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>How to add a YouTube Video Player<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to add a YouTube Video Player\" \/>\n<meta property=\"og:url\" content=\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/\" \/>\n<meta property=\"og:site_name\" content=\"Cloudinary Blog\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-23T22:24:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-15T22:39:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945-jpg?_i=AA\" \/>\n\t<meta property=\"og:image:width\" content=\"5922\" \/>\n\t<meta property=\"og:image:height\" content=\"3948\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"NewsArticle\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"How to add a YouTube Video Player\",\"datePublished\":\"2022-03-23T22:24:21+00:00\",\"dateModified\":\"2025-02-15T22:39:17+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/\"},\"wordCount\":7,\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA\",\"keywords\":[\"Angular\",\"Guest Post\",\"Player Video\",\"Under Review\",\"Video\"],\"inLanguage\":\"en-US\",\"copyrightYear\":\"2022\",\"copyrightHolder\":{\"@id\":\"https:\/\/cloudinary.com\/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/\",\"url\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/\",\"name\":\"How to add a YouTube Video Player\",\"isPartOf\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA\",\"datePublished\":\"2022-03-23T22:24:21+00:00\",\"dateModified\":\"2025-02-15T22:39:17+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA\",\"width\":5922,\"height\":3948},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/cloudinary.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to add a YouTube Video Player\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#website\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"name\":\"Cloudinary Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/cloudinary.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#organization\",\"name\":\"Cloudinary Blog\",\"url\":\"https:\/\/cloudinary.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"contentUrl\":\"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA\",\"width\":312,\"height\":60,\"caption\":\"Cloudinary Blog\"},\"image\":{\"@id\":\"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"How to add a YouTube Video Player","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/","og_locale":"en_US","og_type":"article","og_title":"How to add a YouTube Video Player","og_url":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/","og_site_name":"Cloudinary Blog","article_published_time":"2022-03-23T22:24:21+00:00","article_modified_time":"2025-02-15T22:39:17+00:00","og_image":[{"width":5922,"height":3948,"url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945-jpg?_i=AA","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"NewsArticle","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#article","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/"},"author":{"name":"","@id":""},"headline":"How to add a YouTube Video Player","datePublished":"2022-03-23T22:24:21+00:00","dateModified":"2025-02-15T22:39:17+00:00","mainEntityOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/"},"wordCount":7,"publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA","keywords":["Angular","Guest Post","Player Video","Under Review","Video"],"inLanguage":"en-US","copyrightYear":"2022","copyrightHolder":{"@id":"https:\/\/cloudinary.com\/#organization"}},{"@type":"WebPage","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/","url":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/","name":"How to add a YouTube Video Player","isPartOf":{"@id":"https:\/\/cloudinary.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage"},"thumbnailUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA","datePublished":"2022-03-23T22:24:21+00:00","dateModified":"2025-02-15T22:39:17+00:00","breadcrumb":{"@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#primaryimage","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA","width":5922,"height":3948},{"@type":"BreadcrumbList","@id":"https:\/\/cloudinary.com\/blog\/guest_post\/how-to-add-a-youtube-video-player-in-angular\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/cloudinary.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to add a YouTube Video Player"}]},{"@type":"WebSite","@id":"https:\/\/cloudinary.com\/blog\/#website","url":"https:\/\/cloudinary.com\/blog\/","name":"Cloudinary Blog","description":"","publisher":{"@id":"https:\/\/cloudinary.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/cloudinary.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/cloudinary.com\/blog\/#organization","name":"Cloudinary Blog","url":"https:\/\/cloudinary.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","contentUrl":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1649718331\/Web_Assets\/blog\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877\/cloudinary_logo_for_white_bg_1937437aa7_19374666c7_193742f877.png?_i=AA","width":312,"height":60,"caption":"Cloudinary Blog"},"image":{"@id":"https:\/\/cloudinary.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":""}]}},"jetpack_featured_media_url":"https:\/\/res.cloudinary.com\/cloudinary-marketing\/images\/f_auto,q_auto\/v1681924960\/Web_Assets\/blog\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945\/07248602e6fd9ad7ce55eb6189b7deb069fa22f3-5922x3948-1_28275b6945.jpg?_i=AA","_links":{"self":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28274","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/users\/41"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/comments?post=28274"}],"version-history":[{"count":3,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28274\/revisions"}],"predecessor-version":[{"id":36818,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/posts\/28274\/revisions\/36818"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media\/28275"}],"wp:attachment":[{"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/media?parent=28274"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/categories?post=28274"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudinary.com\/blog\/wp-json\/wp\/v2\/tags?post=28274"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}