angularjs - Embedded YouTube video is not working on asp.net MVC/Angular app -


i have tried embed video shown below on asp.net mvc app.

<div class="col-lg-12 center " data-animation="bounceinright" data-delay="300">      <iframe width="170" height="128" ng-src="https://www.youtube.com/embed/watch?v=1adlyfbuwc8" frameborder="0" allowfullscreen style="max-width:100%; margin:0 auto; display:block;"></iframe> </div> 

but when tried play, shows below error.

enter image description here

there no console window errors.when tried url right clicking above video shows : https://youtu.be/undefined

but when embeded below kind of url works fine.

https://www.youtube.com/embed/a6xuvjk9w4o  

could tell me how sort out issue ? in advance.

answer : think can avoid issue if use video_id @jossef harush mentioned below.

using ng-src in redundant

since don't dynamically set video url in example. no need use ng-src

youtube embed url incorrect

from they're docs:

embed player using tag

define tag in application in src url specifies content player load other player parameters want set. tag's height , width parameters specify dimensions of player.

if create element (rather using iframe player api create it), can append player parameters directly end of url. url has following format:

http://www.youtube.com/embed/video_id

use https://www.youtube.com/embed/a6xuvjk9w4o instead of https://www.youtube.com/embed/watch?v=1adlyfbuwc8

sample on plunker


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -