{"action":"created","issue":{"url":"https://api.github.com/repos/googleads/videojs-ima/issues/270","repository_url":"https://api.github.com/repos/googleads/videojs-ima","labels_url":"https://api.github.com/repos/googleads/videojs-ima/issues/270/labels{/name}","comments_url":"https://api.github.com/repos/googleads/videojs-ima/issues/270/comments","events_url":"https://api.github.com/repos/googleads/videojs-ima/issues/270/events","html_url":"https://github.com/googleads/videojs-ima/issues/270","id":173569901,"number":270,"title":"AdError 501 with forceNonLinearFullSlot","user":{"login":"palcoder","id":384939,"avatar_url":"https://avatars2.githubusercontent.com/u/384939?v=4","gravatar_id":"","url":"https://api.github.com/users/palcoder","html_url":"https://github.com/palcoder","followers_url":"https://api.github.com/users/palcoder/followers","following_url":"https://api.github.com/users/palcoder/following{/other_user}","gists_url":"https://api.github.com/users/palcoder/gists{/gist_id}","starred_url":"https://api.github.com/users/palcoder/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/palcoder/subscriptions","organizations_url":"https://api.github.com/users/palcoder/orgs","repos_url":"https://api.github.com/users/palcoder/repos","events_url":"https://api.github.com/users/palcoder/events{/privacy}","received_events_url":"https://api.github.com/users/palcoder/received_events","type":"User","site_admin":false},"labels":[{"id":109322617,"url":"https://api.github.com/repos/googleads/videojs-ima/labels/support","name":"support","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-08-27T01:09:53Z","updated_at":"2018-03-08T20:25:40Z","closed_at":"2016-09-21T16:16:52Z","author_association":"NONE","body":"Hi,\n\nI have used forceNonLinearFullSlot option to render ads on full player width. It works fine on the preroll with text ads but it does not work in midroll and cause the error \"AdError 501: The overlay ad content could not be displayed since creative dimensions do not align with display area.\".\n\nI tried to find a solution to this issue but cannot find any useful info and my workaround to set nonLinearWidth and nonLinearHeight to the payer dimensions is failed.\n\nThank you\n"},"comment":{"url":"https://api.github.com/repos/googleads/videojs-ima/issues/comments/371613217","html_url":"https://github.com/googleads/videojs-ima/issues/270#issuecomment-371613217","issue_url":"https://api.github.com/repos/googleads/videojs-ima/issues/270","id":371613217,"user":{"login":"dannyf620","id":13239445,"avatar_url":"https://avatars0.githubusercontent.com/u/13239445?v=4","gravatar_id":"","url":"https://api.github.com/users/dannyf620","html_url":"https://github.com/dannyf620","followers_url":"https://api.github.com/users/dannyf620/followers","following_url":"https://api.github.com/users/dannyf620/following{/other_user}","gists_url":"https://api.github.com/users/dannyf620/gists{/gist_id}","starred_url":"https://api.github.com/users/dannyf620/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dannyf620/subscriptions","organizations_url":"https://api.github.com/users/dannyf620/orgs","repos_url":"https://api.github.com/users/dannyf620/repos","events_url":"https://api.github.com/users/dannyf620/events{/privacy}","received_events_url":"https://api.github.com/users/dannyf620/received_events","type":"User","site_admin":false},"created_at":"2018-03-08T20:25:40Z","updated_at":"2018-03-08T20:25:40Z","author_association":"NONE","body":"\r\n\r\nEverything is working well, ads work ok but when the screen of the user is too small it return an adError (503), I made a change in the Advance example [Advanced Example](https://googleads.github.io/videojs-ima/examples/advanced/) resizing the iframe that contain the ad, “this example is **not responsive**, it was the one simple way to replicate the error (501)”\r\n\r\nUncaught AdError 501: The overlay ad content could not be displayed since creative dimensions do not align with display area.\r\n\r\nIn the IMA API documentation  there is a const for the error but I can not handle this error. \r\nIn the event array i add two events and modify the onAddEvent .\r\nthe tag of @palcoder  is a perfect sample. \r\n\r\n```\r\nAds.prototype.SAMPLE_AD_TAG = 'http://googleads.g.doubleclick.net/pagead/ads?ad_type=skippablevideo_text_image_flash&client=ca-video-pub-3701526372767426&description_url=[description_url]&hl=en';\r\n var events = [\r\n ...\r\n    google.ima.AdEvent.Type.NONLINEAR_DIMENSIONS_ERROR,\r\n    google.ima.AdErrorEvent.Type.AD_ERROR\r\n  ];\r\n```\r\n\r\n```\r\nAds.prototype.onAdEvent = function(event) {\r\n  var message = 'Ad event: ' + event.type;\r\n  this.log(message);\r\n  var resizeInterval;\r\n  if (event.type == google.ima.AdEvent.Type.NONLINEAR_DIMENSIONS_ERROR || event.type == google.ima.AdErrorEvent.Type.AD_ERROR) {\r\n    console.log(\"Minimal dimention at: \", document.querySelector('#ima-sample-videoplayer iframe').style.width)\r\n    clearInterval(resizeInterval);\r\n  }\r\n  if (event.type == google.ima.AdEvent.Type.STARTED ) {\r\n    var p = 100;\r\n    resizeInterval = setInterval(function () {\r\n      document.querySelector('#ima-sample-videoplayer iframe').style.width = (p--) + '%';\r\n    }, 100)\r\n  }\r\n};\r\n\r\n```\r\n[fork commit](https://github.com/dannyf620/videojs-ima/commit/b4707136e7a9c5bcab9bd867731c46dd4ff9edba)\r\n- It would can listen the NONLINEAR_DIMENSIONS_ERROR event?\r\n\r\n- Can I change the imaOption \"nonLinearWidth\" and reload ads \"player.ima.requestAds();\"?\r\n\r\n- Or can I detect Ads media (video can resize) (Image force first Styles) \"for last instance\r\nSee\""}}
{"actor":{"display_login":"dannyf620"}}