{"action":"created","comment":{"url":"https://api.github.com/repos/kaltura/liveDVR/pulls/comments/52116610","id":52116610,"diff_hunk":"@@ -9,38 +9,120 @@ var networkClient = require('./NetworkClientFactory').getNetworkClient();\n var url = require('url');\n var config = require('./../common/Configuration');\n \n-module.exports = function(entryId, hostname, port, applicationName, logger) {\n+module.exports = function(entryId, hostname, port, applicationName, flavors, logger) {\n \n     /* jshint shadow:true */\n     var hostname = hostname || 'localhost';\n     var applicationName = applicationName || 'kLive';\n \n-    // Examples:\n-    // http://localhost:1935/test/smil:testStream.smil/playlist.m3u8\n-    // http://localhost:1935/test/smil:testStream.smil/chunklist_w1955191818_b400000.m3u8\n-    var getMediaServerLiveUrl = function getMediaServerLiveUrl(smil)\n-    {\n-        var smil = smil || 'all';\n-        var path = '/' + applicationName + '/smil:' + entryId + \"_\" + smil + \".smil/\";\n-        var resultUrl = url.format({\n+    function getUrlPath(path) {\n+        return url.format({\n             protocol : 'http',\n             hostname : hostname,\n             port : port,\n             pathname : path\n         });\n-        return resultUrl;\n-    };\n+    }\n+\n+    function wowzaBehaviour() {\n+        // Examples:\n+        // Old smil URL\n+        // http://localhost:1935/test/smil:testStream.smil/playlist.m3u8\n+        // http://localhost:1935/test/smil:testStream.smil/chunklist_w1955191818_b400000.m3u8\n+        function getMediaServerLiveUrl(smil) {\n+            var smil = smil || 'all';\n+            var path = '/' + applicationName + '/smil:' + entryId + \"_\" + smil + \".smil/\";\n+            return getUrlPath(path);\n+        }\n+\n+        function getMediaServerManifest(smil) {\n+            return Q.fcall(function(){\n+                var mediaServerBaseUrl = getMediaServerLiveUrl(smil);\n+                var mediaServerPlaylistUrl = url.resolve(mediaServerBaseUrl, 'playlist.m3u8');\n+                logger.info(\"Sending request for \" + mediaServerPlaylistUrl);\n+                return networkClient.read(mediaServerPlaylistUrl);\n+            }).then(function(manifestData){\n+                return m3u8Parser.parseM3U8(manifestData, {'verbatim' : true});\n+            });\n+        }\n \n-    var getMediaServerManifest = function(smil){\n-        return Q.fcall(function(){\n-            var mediaServerBaseUrl = getMediaServerLiveUrl(smil);\n-            var mediaServerPlaylistUrl = url.resolve(mediaServerBaseUrl, 'playlist.m3u8');\n-            logger.info(\"Sending request for \" + mediaServerPlaylistUrl);\n-            return networkClient.read(mediaServerPlaylistUrl);\n-        }).then(function(manifestData){\n-            return m3u8Parser.parseM3U8(manifestData, {'verbatim' : true});\n+        return{\n+            getMediaServerManifest : getMediaServerManifest,\n+            getMediaServerLiveUrl : getMediaServerLiveUrl\n+        };\n+    }\n+\n+\n+    function retryPromise(fn, intervalRetry, maxRetries, errorString) {\n+        //logger.debug(\"retryPromise\");\n+        return fn().catch(function() { // if it fails\n+                return Q.delay(intervalRetry) // delay\n+                    // retry with more time\n+                    .then(function(){\n+                        if (maxRetries <= 0) {\n+                            throw new Error(errorString + \" (after \"+ maxRetries + \" retries)\");\n+                        }\n+                        return retryPromise(fn, intervalRetry, maxRetries - 1);\n+                    });\n         });\n-    };\n+    }\n+\n+    function newBehaviour() {","path":"lib/MasterManifestGenerator.js","position":82,"original_position":82,"commit_id":"befb5390a62fa2d31bd17e0d2ce26c5f1fa39547","original_commit_id":"befb5390a62fa2d31bd17e0d2ce26c5f1fa39547","user":{"login":"kalturaguy","id":7511565,"avatar_url":"https://avatars.githubusercontent.com/u/7511565?v=3","gravatar_id":"","url":"https://api.github.com/users/kalturaguy","html_url":"https://github.com/kalturaguy","followers_url":"https://api.github.com/users/kalturaguy/followers","following_url":"https://api.github.com/users/kalturaguy/following{/other_user}","gists_url":"https://api.github.com/users/kalturaguy/gists{/gist_id}","starred_url":"https://api.github.com/users/kalturaguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalturaguy/subscriptions","organizations_url":"https://api.github.com/users/kalturaguy/orgs","repos_url":"https://api.github.com/users/kalturaguy/repos","events_url":"https://api.github.com/users/kalturaguy/events{/privacy}","received_events_url":"https://api.github.com/users/kalturaguy/received_events","type":"User","site_admin":false},"body":"put in a differnt file","created_at":"2016-02-07T12:21:29Z","updated_at":"2016-02-07T12:21:29Z","html_url":"https://github.com/kaltura/liveDVR/pull/108#discussion_r52116610","pull_request_url":"https://api.github.com/repos/kaltura/liveDVR/pulls/108","_links":{"self":{"href":"https://api.github.com/repos/kaltura/liveDVR/pulls/comments/52116610"},"html":{"href":"https://github.com/kaltura/liveDVR/pull/108#discussion_r52116610"},"pull_request":{"href":"https://api.github.com/repos/kaltura/liveDVR/pulls/108"}}},"pull_request":{"url":"https://api.github.com/repos/kaltura/liveDVR/pulls/108","id":58545294,"html_url":"https://github.com/kaltura/liveDVR/pull/108","diff_url":"https://github.com/kaltura/liveDVR/pull/108.diff","patch_url":"https://github.com/kaltura/liveDVR/pull/108.patch","issue_url":"https://api.github.com/repos/kaltura/liveDVR/issues/108","number":108,"state":"open","locked":false,"title":"PLAT-5021 remove smil from all url requests","user":{"login":"gadyaari","id":15606217,"avatar_url":"https://avatars.githubusercontent.com/u/15606217?v=3","gravatar_id":"","url":"https://api.github.com/users/gadyaari","html_url":"https://github.com/gadyaari","followers_url":"https://api.github.com/users/gadyaari/followers","following_url":"https://api.github.com/users/gadyaari/following{/other_user}","gists_url":"https://api.github.com/users/gadyaari/gists{/gist_id}","starred_url":"https://api.github.com/users/gadyaari/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gadyaari/subscriptions","organizations_url":"https://api.github.com/users/gadyaari/orgs","repos_url":"https://api.github.com/users/gadyaari/repos","events_url":"https://api.github.com/users/gadyaari/events{/privacy}","received_events_url":"https://api.github.com/users/gadyaari/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-02-07T12:18:39Z","updated_at":"2016-02-07T12:21:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"89fa19c922d4f6209482fe9318dec6ce7cba522f","assignee":{"login":"kalturaguy","id":7511565,"avatar_url":"https://avatars.githubusercontent.com/u/7511565?v=3","gravatar_id":"","url":"https://api.github.com/users/kalturaguy","html_url":"https://github.com/kalturaguy","followers_url":"https://api.github.com/users/kalturaguy/followers","following_url":"https://api.github.com/users/kalturaguy/following{/other_user}","gists_url":"https://api.github.com/users/kalturaguy/gists{/gist_id}","starred_url":"https://api.github.com/users/kalturaguy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kalturaguy/subscriptions","organizations_url":"https://api.github.com/users/kalturaguy/orgs","repos_url":"https://api.github.com/users/kalturaguy/repos","events_url":"https://api.github.com/users/kalturaguy/events{/privacy}","received_events_url":"https://api.github.com/users/kalturaguy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kaltura/liveDVR/pulls/108/commits","review_comments_url":"https://api.github.com/repos/kaltura/liveDVR/pulls/108/comments","review_comment_url":"https://api.github.com/repos/kaltura/liveDVR/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kaltura/liveDVR/issues/108/comments","statuses_url":"https://api.github.com/repos/kaltura/liveDVR/statuses/befb5390a62fa2d31bd17e0d2ce26c5f1fa39547","head":{"label":"kaltura:PLAT-5021-no-smil","ref":"PLAT-5021-no-smil","sha":"befb5390a62fa2d31bd17e0d2ce26c5f1fa39547","user":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"repo":{"id":40581240,"name":"liveDVR","full_name":"kaltura/liveDVR","owner":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaltura/liveDVR","description":"DVR implementation built on top of live streams","fork":false,"url":"https://api.github.com/repos/kaltura/liveDVR","forks_url":"https://api.github.com/repos/kaltura/liveDVR/forks","keys_url":"https://api.github.com/repos/kaltura/liveDVR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaltura/liveDVR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaltura/liveDVR/teams","hooks_url":"https://api.github.com/repos/kaltura/liveDVR/hooks","issue_events_url":"https://api.github.com/repos/kaltura/liveDVR/issues/events{/number}","events_url":"https://api.github.com/repos/kaltura/liveDVR/events","assignees_url":"https://api.github.com/repos/kaltura/liveDVR/assignees{/user}","branches_url":"https://api.github.com/repos/kaltura/liveDVR/branches{/branch}","tags_url":"https://api.github.com/repos/kaltura/liveDVR/tags","blobs_url":"https://api.github.com/repos/kaltura/liveDVR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaltura/liveDVR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaltura/liveDVR/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaltura/liveDVR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaltura/liveDVR/statuses/{sha}","languages_url":"https://api.github.com/repos/kaltura/liveDVR/languages","stargazers_url":"https://api.github.com/repos/kaltura/liveDVR/stargazers","contributors_url":"https://api.github.com/repos/kaltura/liveDVR/contributors","subscribers_url":"https://api.github.com/repos/kaltura/liveDVR/subscribers","subscription_url":"https://api.github.com/repos/kaltura/liveDVR/subscription","commits_url":"https://api.github.com/repos/kaltura/liveDVR/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaltura/liveDVR/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaltura/liveDVR/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaltura/liveDVR/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaltura/liveDVR/contents/{+path}","compare_url":"https://api.github.com/repos/kaltura/liveDVR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaltura/liveDVR/merges","archive_url":"https://api.github.com/repos/kaltura/liveDVR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaltura/liveDVR/downloads","issues_url":"https://api.github.com/repos/kaltura/liveDVR/issues{/number}","pulls_url":"https://api.github.com/repos/kaltura/liveDVR/pulls{/number}","milestones_url":"https://api.github.com/repos/kaltura/liveDVR/milestones{/number}","notifications_url":"https://api.github.com/repos/kaltura/liveDVR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaltura/liveDVR/labels{/name}","releases_url":"https://api.github.com/repos/kaltura/liveDVR/releases{/id}","deployments_url":"https://api.github.com/repos/kaltura/liveDVR/deployments","created_at":"2015-08-12T05:08:28Z","updated_at":"2016-01-13T11:00:36Z","pushed_at":"2016-02-07T12:18:39Z","git_url":"git://github.com/kaltura/liveDVR.git","ssh_url":"git@github.com:kaltura/liveDVR.git","clone_url":"https://github.com/kaltura/liveDVR.git","svn_url":"https://github.com/kaltura/liveDVR","homepage":null,"size":39485,"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":8,"forks":1,"open_issues":8,"watchers":1,"default_branch":"master"}},"base":{"label":"kaltura:master","ref":"master","sha":"27c7e8b8982633c8edcf5f5f8ec7c6f41b638c05","user":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"repo":{"id":40581240,"name":"liveDVR","full_name":"kaltura/liveDVR","owner":{"login":"kaltura","id":319096,"avatar_url":"https://avatars.githubusercontent.com/u/319096?v=3","gravatar_id":"","url":"https://api.github.com/users/kaltura","html_url":"https://github.com/kaltura","followers_url":"https://api.github.com/users/kaltura/followers","following_url":"https://api.github.com/users/kaltura/following{/other_user}","gists_url":"https://api.github.com/users/kaltura/gists{/gist_id}","starred_url":"https://api.github.com/users/kaltura/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kaltura/subscriptions","organizations_url":"https://api.github.com/users/kaltura/orgs","repos_url":"https://api.github.com/users/kaltura/repos","events_url":"https://api.github.com/users/kaltura/events{/privacy}","received_events_url":"https://api.github.com/users/kaltura/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kaltura/liveDVR","description":"DVR implementation built on top of live streams","fork":false,"url":"https://api.github.com/repos/kaltura/liveDVR","forks_url":"https://api.github.com/repos/kaltura/liveDVR/forks","keys_url":"https://api.github.com/repos/kaltura/liveDVR/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kaltura/liveDVR/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kaltura/liveDVR/teams","hooks_url":"https://api.github.com/repos/kaltura/liveDVR/hooks","issue_events_url":"https://api.github.com/repos/kaltura/liveDVR/issues/events{/number}","events_url":"https://api.github.com/repos/kaltura/liveDVR/events","assignees_url":"https://api.github.com/repos/kaltura/liveDVR/assignees{/user}","branches_url":"https://api.github.com/repos/kaltura/liveDVR/branches{/branch}","tags_url":"https://api.github.com/repos/kaltura/liveDVR/tags","blobs_url":"https://api.github.com/repos/kaltura/liveDVR/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kaltura/liveDVR/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kaltura/liveDVR/git/refs{/sha}","trees_url":"https://api.github.com/repos/kaltura/liveDVR/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kaltura/liveDVR/statuses/{sha}","languages_url":"https://api.github.com/repos/kaltura/liveDVR/languages","stargazers_url":"https://api.github.com/repos/kaltura/liveDVR/stargazers","contributors_url":"https://api.github.com/repos/kaltura/liveDVR/contributors","subscribers_url":"https://api.github.com/repos/kaltura/liveDVR/subscribers","subscription_url":"https://api.github.com/repos/kaltura/liveDVR/subscription","commits_url":"https://api.github.com/repos/kaltura/liveDVR/commits{/sha}","git_commits_url":"https://api.github.com/repos/kaltura/liveDVR/git/commits{/sha}","comments_url":"https://api.github.com/repos/kaltura/liveDVR/comments{/number}","issue_comment_url":"https://api.github.com/repos/kaltura/liveDVR/issues/comments{/number}","contents_url":"https://api.github.com/repos/kaltura/liveDVR/contents/{+path}","compare_url":"https://api.github.com/repos/kaltura/liveDVR/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kaltura/liveDVR/merges","archive_url":"https://api.github.com/repos/kaltura/liveDVR/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kaltura/liveDVR/downloads","issues_url":"https://api.github.com/repos/kaltura/liveDVR/issues{/number}","pulls_url":"https://api.github.com/repos/kaltura/liveDVR/pulls{/number}","milestones_url":"https://api.github.com/repos/kaltura/liveDVR/milestones{/number}","notifications_url":"https://api.github.com/repos/kaltura/liveDVR/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kaltura/liveDVR/labels{/name}","releases_url":"https://api.github.com/repos/kaltura/liveDVR/releases{/id}","deployments_url":"https://api.github.com/repos/kaltura/liveDVR/deployments","created_at":"2015-08-12T05:08:28Z","updated_at":"2016-01-13T11:00:36Z","pushed_at":"2016-02-07T12:18:39Z","git_url":"git://github.com/kaltura/liveDVR.git","ssh_url":"git@github.com:kaltura/liveDVR.git","clone_url":"https://github.com/kaltura/liveDVR.git","svn_url":"https://github.com/kaltura/liveDVR","homepage":null,"size":39485,"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":8,"forks":1,"open_issues":8,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kaltura/liveDVR/pulls/108"},"html":{"href":"https://github.com/kaltura/liveDVR/pull/108"},"issue":{"href":"https://api.github.com/repos/kaltura/liveDVR/issues/108"},"comments":{"href":"https://api.github.com/repos/kaltura/liveDVR/issues/108/comments"},"review_comments":{"href":"https://api.github.com/repos/kaltura/liveDVR/pulls/108/comments"},"review_comment":{"href":"https://api.github.com/repos/kaltura/liveDVR/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kaltura/liveDVR/pulls/108/commits"},"statuses":{"href":"https://api.github.com/repos/kaltura/liveDVR/statuses/befb5390a62fa2d31bd17e0d2ce26c5f1fa39547"}}}}