javascript - Play video using YouTube Iframe API after ajax call in mobile -


i building application user enter text , click button. based on text service call , fetch youtube video. using youtube iframe api, , after fetch data server load , play video.

the thing doesn't work on mobile device, because mobile devices allow me play video javascript if in callback user input, since need fetch data server first, can't play video user click callback, need on ajax call callback.

do knows workaround on that?

edit: make more clear give example. not actual code illustrates issue

//playv button on screen $("#playv").click(function(){     /*this function works on mobile without issues     since callback user input*/     player.playvideo();      $.getjson("http://api.openweathermap.org/data/2.5/weather?id=2172797", function(data){          /*this function doesn't work here since           callback of ajax call , not user input */           /*i want make works somehow*/          player.playvideo();      }) }); 


Comments

Popular posts from this blog

Fail to load namespace Spring Security http://www.springframework.org/security/tags -

sql - MySQL query optimization using coalesce -

unity3d - Unity local avoidance in user created world -