{"action":"created","comment":{"url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments/56737744","id":56737744,"diff_hunk":"@@ -483,6 +546,85 @@ OO.Ads.manager(function(_, $) {\n     this.initialize = function(amc) {\n       this.amc = amc;\n       this.amc.addPlayerListener(this.amc.EVENTS.INITIAL_PLAY_REQUESTED, _.bind(this.initialPlay, this));\n+      this.amc.addPlayerListener(this.amc.EVENTS.FULLSCREEN_CHANGED, _.bind(_onFullscreenChanged, this));\n+      this.amc.addPlayerListener(this.amc.EVENTS.SIZE_CHANGED, _onSizeChanged);\n+    };\n+\n+    /**\n+     * Callback when the media file is loaded. Once is loaded we can initialize the ad\n+     * @private\n+     */\n+    var _initializeAd = _.bind(function() {\n+      var eventName,\n+          environmentVariables,\n+          viewMode,\n+          creativeData = {};\n+\n+      currentAd.data = currentAd.ad.data;\n+\n+      if (typeof iframe.contentWindow.getVPAIDAd !== 'function') {\n+        OO.log('VPaid: Required function getVPAIDAd() is not defined.');\n+        return;\n+      }\n+      currentAd.vpaidAd = iframe.contentWindow.getVPAIDAd();\n+\n+      // Subscribe to ad unit events\n+      for (eventName in VPAID_EVENTS) {\n+        currentAd.vpaidAd.subscribe(_.bind(_onAdEvent, this, VPAID_EVENTS[eventName]),\n+            VPAID_EVENTS[eventName], this);\n+      }\n+\n+      this._slot = _createUniqueElement();\n+      this._videoSlot = this.amc.ui.adVideoElement[0];\n+\n+      environmentVariables = _.extend({\n+        slot: this._slot,\n+        videoSlot: this._videoSlot,\n+        videoSlotCanAutoPlay: true\n+      }, this.environmentVariables);\n+\n+      this._properties = {\n+        adWidth: this._slot.offsetWidth,\n+        adHeight: this._slot.offsetHeight,\n+        adDesiredBitrate: 600,\n+      };\n+\n+      viewMode = _getFsState() ? 'fullscreen' : 'normal';\n+      creativeData = {\n+        AdParameters: currentAd.ad.adParams\n+      };\n+\n+      this.initAd(this._properties['adWidth'], this._properties['adHeight'], viewMode,\n+                  this._properties['adDesiredBitrate'], environmentVariables, creativeData);\n+    }, this);\n+\n+    /**\n+     * Initializes the ad by sending the data to the ad unit.\n+     * @public\n+     * @method VPaid#initAd","path":"js/ad_manager_vast.js","position":null,"original_position":140,"commit_id":"d6f22da1e7305610e4949efe94677f7c0c09f036","original_commit_id":"b4798d5062b6f60e016da665a9b990e55705610c","user":{"login":"nevermind89x","id":1046289,"avatar_url":"https://avatars.githubusercontent.com/u/1046289?v=3","gravatar_id":"","url":"https://api.github.com/users/nevermind89x","html_url":"https://github.com/nevermind89x","followers_url":"https://api.github.com/users/nevermind89x/followers","following_url":"https://api.github.com/users/nevermind89x/following{/other_user}","gists_url":"https://api.github.com/users/nevermind89x/gists{/gist_id}","starred_url":"https://api.github.com/users/nevermind89x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevermind89x/subscriptions","organizations_url":"https://api.github.com/users/nevermind89x/orgs","repos_url":"https://api.github.com/users/nevermind89x/repos","events_url":"https://api.github.com/users/nevermind89x/events{/privacy}","received_events_url":"https://api.github.com/users/nevermind89x/received_events","type":"User","site_admin":false},"body":"Done.","created_at":"2016-03-18T23:58:59Z","updated_at":"2016-03-18T23:58:59Z","html_url":"https://github.com/ooyala/html5-ad-plugins/pull/68#discussion_r56737744","pull_request_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68","_links":{"self":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments/56737744"},"html":{"href":"https://github.com/ooyala/html5-ad-plugins/pull/68#discussion_r56737744"},"pull_request":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68"}}},"pull_request":{"url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68","id":63406436,"html_url":"https://github.com/ooyala/html5-ad-plugins/pull/68","diff_url":"https://github.com/ooyala/html5-ad-plugins/pull/68.diff","patch_url":"https://github.com/ooyala/html5-ad-plugins/pull/68.patch","issue_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/68","number":68,"state":"open","locked":false,"title":"VAST/VPAID refactor","user":{"login":"nevermind89x","id":1046289,"avatar_url":"https://avatars.githubusercontent.com/u/1046289?v=3","gravatar_id":"","url":"https://api.github.com/users/nevermind89x","html_url":"https://github.com/nevermind89x","followers_url":"https://api.github.com/users/nevermind89x/followers","following_url":"https://api.github.com/users/nevermind89x/following{/other_user}","gists_url":"https://api.github.com/users/nevermind89x/gists{/gist_id}","starred_url":"https://api.github.com/users/nevermind89x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nevermind89x/subscriptions","organizations_url":"https://api.github.com/users/nevermind89x/orgs","repos_url":"https://api.github.com/users/nevermind89x/repos","events_url":"https://api.github.com/users/nevermind89x/events{/privacy}","received_events_url":"https://api.github.com/users/nevermind89x/received_events","type":"User","site_admin":false},"body":"Still missing some stuff to refactor, but I feel at this point this was the safest changes I was able to make. This should also fix some (if not all) of the issues with those fake podded ads from backlot. Hopefully won't cause any others.","created_at":"2016-03-18T17:07:07Z","updated_at":"2016-03-18T23:58:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"7ab1b33f201a7732e10ea1f2d7ab3b4776e68819","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68/commits","review_comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68/comments","review_comment_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/68/comments","statuses_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/d6f22da1e7305610e4949efe94677f7c0c09f036","head":{"label":"ooyala:vast-vpaid","ref":"vast-vpaid","sha":"d6f22da1e7305610e4949efe94677f7c0c09f036","user":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"repo":{"id":33886489,"name":"html5-ad-plugins","full_name":"ooyala/html5-ad-plugins","owner":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ooyala/html5-ad-plugins","description":"","fork":false,"url":"https://api.github.com/repos/ooyala/html5-ad-plugins","forks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/forks","keys_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/teams","hooks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/hooks","issue_events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/events","assignees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/tags","blobs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/languages","stargazers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/stargazers","contributors_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contributors","subscribers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscribers","subscription_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscription","commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/merges","archive_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/downloads","issues_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/labels{/name}","releases_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/deployments","created_at":"2015-04-13T18:37:19Z","updated_at":"2016-02-10T15:14:21Z","pushed_at":"2016-03-18T23:58:57Z","git_url":"git://github.com/ooyala/html5-ad-plugins.git","ssh_url":"git@github.com:ooyala/html5-ad-plugins.git","clone_url":"https://github.com/ooyala/html5-ad-plugins.git","svn_url":"https://github.com/ooyala/html5-ad-plugins","homepage":null,"size":448,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"base":{"label":"ooyala:master","ref":"master","sha":"7f36762d84da3cf555878827843e7ae68c16e843","user":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"repo":{"id":33886489,"name":"html5-ad-plugins","full_name":"ooyala/html5-ad-plugins","owner":{"login":"ooyala","id":365274,"avatar_url":"https://avatars.githubusercontent.com/u/365274?v=3","gravatar_id":"","url":"https://api.github.com/users/ooyala","html_url":"https://github.com/ooyala","followers_url":"https://api.github.com/users/ooyala/followers","following_url":"https://api.github.com/users/ooyala/following{/other_user}","gists_url":"https://api.github.com/users/ooyala/gists{/gist_id}","starred_url":"https://api.github.com/users/ooyala/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ooyala/subscriptions","organizations_url":"https://api.github.com/users/ooyala/orgs","repos_url":"https://api.github.com/users/ooyala/repos","events_url":"https://api.github.com/users/ooyala/events{/privacy}","received_events_url":"https://api.github.com/users/ooyala/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ooyala/html5-ad-plugins","description":"","fork":false,"url":"https://api.github.com/repos/ooyala/html5-ad-plugins","forks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/forks","keys_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/teams","hooks_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/hooks","issue_events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/events{/number}","events_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/events","assignees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/assignees{/user}","branches_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/branches{/branch}","tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/tags","blobs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/refs{/sha}","trees_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/{sha}","languages_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/languages","stargazers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/stargazers","contributors_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contributors","subscribers_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscribers","subscription_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/subscription","commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/commits{/sha}","git_commits_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/git/commits{/sha}","comments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/comments{/number}","issue_comment_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/comments{/number}","contents_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/contents/{+path}","compare_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/merges","archive_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/downloads","issues_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues{/number}","pulls_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls{/number}","milestones_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/milestones{/number}","notifications_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/labels{/name}","releases_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/releases{/id}","deployments_url":"https://api.github.com/repos/ooyala/html5-ad-plugins/deployments","created_at":"2015-04-13T18:37:19Z","updated_at":"2016-02-10T15:14:21Z","pushed_at":"2016-03-18T23:58:57Z","git_url":"git://github.com/ooyala/html5-ad-plugins.git","ssh_url":"git@github.com:ooyala/html5-ad-plugins.git","clone_url":"https://github.com/ooyala/html5-ad-plugins.git","svn_url":"https://github.com/ooyala/html5-ad-plugins","homepage":null,"size":448,"stargazers_count":1,"watchers_count":1,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":4,"forks":1,"open_issues":4,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68"},"html":{"href":"https://github.com/ooyala/html5-ad-plugins/pull/68"},"issue":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/68"},"comments":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/issues/68/comments"},"review_comments":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68/comments"},"review_comment":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/pulls/68/commits"},"statuses":{"href":"https://api.github.com/repos/ooyala/html5-ad-plugins/statuses/d6f22da1e7305610e4949efe94677f7c0c09f036"}}}}