{"action":"created","issue":{"url":"https://api.github.com/repos/videojs/videojs-contrib-ads/issues/166","repository_url":"https://api.github.com/repos/videojs/videojs-contrib-ads","labels_url":"https://api.github.com/repos/videojs/videojs-contrib-ads/issues/166/labels{/name}","comments_url":"https://api.github.com/repos/videojs/videojs-contrib-ads/issues/166/comments","events_url":"https://api.github.com/repos/videojs/videojs-contrib-ads/issues/166/events","html_url":"https://github.com/videojs/videojs-contrib-ads/issues/166","id":155660714,"number":166,"title":"Cannot get player snapshot when player.duration() is Infinity","user":{"login":"nonth","id":389117,"avatar_url":"https://avatars.githubusercontent.com/u/389117?v=3","gravatar_id":"","url":"https://api.github.com/users/nonth","html_url":"https://github.com/nonth","followers_url":"https://api.github.com/users/nonth/followers","following_url":"https://api.github.com/users/nonth/following{/other_user}","gists_url":"https://api.github.com/users/nonth/gists{/gist_id}","starred_url":"https://api.github.com/users/nonth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nonth/subscriptions","organizations_url":"https://api.github.com/users/nonth/orgs","repos_url":"https://api.github.com/users/nonth/repos","events_url":"https://api.github.com/users/nonth/events{/privacy}","received_events_url":"https://api.github.com/users/nonth/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-05-19T06:06:08Z","updated_at":"2016-05-24T15:37:22Z","closed_at":null,"body":"Hi, I am trying to use the ads plugin to play preroll ads on HLS live stream (ads video is in mp4 format)\r\n\r\nWhen playing live stream player.duration return infinity and contrib-ads will get snapshot when browser is iOS or player.duration is not infinity\r\n\r\nA code below is from fsmHandler function in 'ad-playback' state\r\n```javascript\r\n\r\n// capture current player state snapshot (playing, currentTime, src)\r\nif (videojs.browser.IS_IOS || player.duration() !== Infinity) {\r\n    this.snapshot = getPlayerSnapshot(player);\r\n}\r\n\r\n```\r\n\r\nWhy we have to check player.duration() is not infinity before get a snapshot ? and is it possible to fix this issue by remove check player.duration() !== Infinity ?\r\n\r\n## Versions\r\n- videojs - v5.9.2\r\n- videojs-contrib-hls - v1.3.11\r\n- videojs-contrib-ads - v3.2.0"},"comment":{"url":"https://api.github.com/repos/videojs/videojs-contrib-ads/issues/comments/221311400","html_url":"https://github.com/videojs/videojs-contrib-ads/issues/166#issuecomment-221311400","issue_url":"https://api.github.com/repos/videojs/videojs-contrib-ads/issues/166","id":221311400,"user":{"login":"incompl","id":211047,"avatar_url":"https://avatars.githubusercontent.com/u/211047?v=3","gravatar_id":"","url":"https://api.github.com/users/incompl","html_url":"https://github.com/incompl","followers_url":"https://api.github.com/users/incompl/followers","following_url":"https://api.github.com/users/incompl/following{/other_user}","gists_url":"https://api.github.com/users/incompl/gists{/gist_id}","starred_url":"https://api.github.com/users/incompl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/incompl/subscriptions","organizations_url":"https://api.github.com/users/incompl/orgs","repos_url":"https://api.github.com/users/incompl/repos","events_url":"https://api.github.com/users/incompl/events{/privacy}","received_events_url":"https://api.github.com/users/incompl/received_events","type":"User","site_admin":false},"created_at":"2016-05-24T15:37:22Z","updated_at":"2016-05-24T15:37:22Z","body":"The reason the code doesn't take snapshots for live streams is because ads _during_ a live stream typically do not pause the content video, they are played over it. In your case, I assume you are trying to play a preroll before the live stream itself starts, which is why you want a snapshot, yes? Maybe we could add an option for something like `useSnapshotWhenLive`. What do you think?"}}
{"actor":{"display_login":"incompl"}}