{"action":"closed","issue":{"url":"https://api.github.com/repos/Modernizr/Modernizr/issues/1601","labels_url":"https://api.github.com/repos/Modernizr/Modernizr/issues/1601/labels{/name}","comments_url":"https://api.github.com/repos/Modernizr/Modernizr/issues/1601/comments","events_url":"https://api.github.com/repos/Modernizr/Modernizr/issues/1601/events","html_url":"https://github.com/Modernizr/Modernizr/issues/1601","id":78353097,"number":1601,"title":"Vide.play() not working from inside Modernizer.on('videoautoplay', function(){.. call","user":{"login":"erichonkanen","id":230757,"avatar_url":"https://avatars.githubusercontent.com/u/230757?v=3","gravatar_id":"","url":"https://api.github.com/users/erichonkanen","html_url":"https://github.com/erichonkanen","followers_url":"https://api.github.com/users/erichonkanen/followers","following_url":"https://api.github.com/users/erichonkanen/following{/other_user}","gists_url":"https://api.github.com/users/erichonkanen/gists{/gist_id}","starred_url":"https://api.github.com/users/erichonkanen/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/erichonkanen/subscriptions","organizations_url":"https://api.github.com/users/erichonkanen/orgs","repos_url":"https://api.github.com/users/erichonkanen/repos","events_url":"https://api.github.com/users/erichonkanen/events{/privacy}","received_events_url":"https://api.github.com/users/erichonkanen/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-20T03:36:27Z","updated_at":"2015-05-20T06:30:28Z","closed_at":"2015-05-20T06:30:28Z","body":"Hello,\r\n\r\nI am trying to add autodetect for html5 video autoplay to my app and found Modernizr v3, however when I initiate the autoplay from inside the .on() callback, it doesn't work. I realize this is async but is there a way to make it work?\r\n\r\n```\r\nimport Ember from 'ember'\r\n\r\nIndexView = Ember.View.extend\r\n  didInsertElement: ()->\r\n    wW = Ember.$(window).width()\r\n    $video = Ember.$('.landing-video')\r\n\r\n    # Initiate landing video playback if the feature is supported.\r\n    Modernizr.on 'videoautoplay', (result)->\r\n      if result\r\n        $player = $video[0]\r\n\r\n        Ember.$.each Ember.$('source'), (index, value)->\r\n          Ember.$(value).attr 'src', Ember.$(value).attr('data-src')\r\n\r\n        $player.play()\r\n\r\n        # Handle video ending - fix for chrome replay bug.\r\n        $player.onended = ()->\r\n          $player.load()\r\n          $player.play()\r\n\r\n\r\nexport default IndexView\r\n```"}}