Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

ng-attr-poster does not work in video tag #15130

Closed
amitport opened this issue Sep 13, 2016 · 4 comments
Closed

ng-attr-poster does not work in video tag #15130

amitport opened this issue Sep 13, 2016 · 4 comments

Comments

@amitport
Copy link

amitport commented Sep 13, 2016

Do you want to request a feature or report a bug?
bug

What is the current behavior?
ng-attr-poster is ignored on video tag

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (template: http://plnkr.co/edit/tpl:yBpEi4).
http://plnkr.co/edit/1QhnA9xb5BgyzWHpeL7O?p=preview

What is the expected behavior?
should see the poster image on video...

What is the motivation / use case for changing the behavior?
poster frame is needed for nice ux

Which versions of Angular, and which browser / OS are affected by this issue? Did this work in previous versions of Angular? Please also test with the latest stable and snapshot (https://code.angularjs.org/snapshot/) versions.
angular 1.5.8
win 7
chrome 53, IE 11, firefox 47

Other information (e.g. stacktraces, related issues, suggestions how to fix)
see related PR #4408

@amitport
Copy link
Author

managed to make it work using

ng-attr-poster="{{'//placekitten.com/g/400/300'}}"
instead of
ng-attr-poster="placekitten.com/g/400/300"

Not sure if that was the intended behavior. In any case, it's not very intuitive

@Narretz
Copy link
Contributor

Narretz commented Sep 13, 2016

ng-attr is for dynamic values / values that are on the scope. If your value is static, then you don't need ng-attr. Your working example initializes a useless watcher on the scope.

@Narretz Narretz closed this as completed Sep 13, 2016
@amitport
Copy link
Author

amitport commented Sep 13, 2016

Of course I wasn't planning on keeping the hard coded value, but during some experimenting I was expecting to see some effect.

After looking at the implementation I see the root cause is allOrNothing interpolation behaviour (https://github.com/angular/angular.js/blob/v1.5.8/src/ng/interpolate.js#L162). IMHO, allOrNothing should return the value when there is nothing to interpolate (nothing interpolated still means that "all" interpolated to truthy values).

@Narretz
Copy link
Contributor

Narretz commented Sep 13, 2016

Ok, if this is an issue with allOrnNothing, then please open a new issue / PR that explains the issue more generic.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants