{"action":"closed","issue":{"url":"https://api.github.com/repos/pupunzi/jquery.mb.YTPlayer/issues/121","repository_url":"https://api.github.com/repos/pupunzi/jquery.mb.YTPlayer","labels_url":"https://api.github.com/repos/pupunzi/jquery.mb.YTPlayer/issues/121/labels{/name}","comments_url":"https://api.github.com/repos/pupunzi/jquery.mb.YTPlayer/issues/121/comments","events_url":"https://api.github.com/repos/pupunzi/jquery.mb.YTPlayer/issues/121/events","html_url":"https://github.com/pupunzi/jquery.mb.YTPlayer/issues/121","id":82205904,"number":121,"title":"Ajax Call - Reinitialize bg Player to pull new contents link information.","user":{"login":"allisongrey","id":9970026,"avatar_url":"https://avatars.githubusercontent.com/u/9970026?v=3","gravatar_id":"","url":"https://api.github.com/users/allisongrey","html_url":"https://github.com/allisongrey","followers_url":"https://api.github.com/users/allisongrey/followers","following_url":"https://api.github.com/users/allisongrey/following{/other_user}","gists_url":"https://api.github.com/users/allisongrey/gists{/gist_id}","starred_url":"https://api.github.com/users/allisongrey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/allisongrey/subscriptions","organizations_url":"https://api.github.com/users/allisongrey/orgs","repos_url":"https://api.github.com/users/allisongrey/repos","events_url":"https://api.github.com/users/allisongrey/events{/privacy}","received_events_url":"https://api.github.com/users/allisongrey/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-05-29T01:36:33Z","updated_at":"2016-02-05T21:22:48Z","closed_at":"2016-02-05T21:22:48Z","body":"I am running a bgvideo that loads per page. It works fine for each page until I use Ajax to move from page to page. The Wrapper is created by the plugin in wordpress outside the ajax content area. I have tried putting:\r\n\r\n  $(function(){\r\n      $(\".player\").YTPlayer();\r\n        });\r\n\r\n.. inside for the initialize page function that is trigger when ajax loads the new content. Doing this for the other functions I am running works fine, but not for this one. Am I calling the wrong thing? \r\n\r\nThis code is in the top of each page inside of the ajax-content wrap:\r\n\r\n <div id=\"bgndVideo\" class=\"player\" \r\n     data-property=\"{videoURL:'<?php echo $youtube_url; ?>',containment:'body',autoPlay:true, quality:'defailt', mute:false, showControls:false, realfullscreen:false, startAt:<?php echo $youtube_startoffset; ?>, opacity:1}\">\r\n</div> \r\n\r\nIt refreshes fine from page to page but the .mbYTP_wrapper div that the plugin creates stays the same with the same link. It doesn't continue playing though it pauses on the load so its not even completely working outside of the ajax.\r\n\r\nI also can't figure out how to recall the playerstate to update buttons etc if the video is playing or has stopped etc. This isn't a huge deal because I don't actually want the player to work outside the ajax, I want it to be destroyed and reinitialized with the new pages link / settings on every content pull.\r\n\r\nAny help would be super appreciated!\r\n\r\n"}}