{"action":"created","issue":{"url":"https://api.github.com/repos/clappr/clappr/issues/1216","repository_url":"https://api.github.com/repos/clappr/clappr","labels_url":"https://api.github.com/repos/clappr/clappr/issues/1216/labels{/name}","comments_url":"https://api.github.com/repos/clappr/clappr/issues/1216/comments","events_url":"https://api.github.com/repos/clappr/clappr/issues/1216/events","html_url":"https://github.com/clappr/clappr/issues/1216","id":189319355,"number":1216,"title":"Restart HLS stream after it stopped playing","user":{"login":"rgroothuis","id":14161204,"avatar_url":"https://avatars.githubusercontent.com/u/14161204?v=3","gravatar_id":"","url":"https://api.github.com/users/rgroothuis","html_url":"https://github.com/rgroothuis","followers_url":"https://api.github.com/users/rgroothuis/followers","following_url":"https://api.github.com/users/rgroothuis/following{/other_user}","gists_url":"https://api.github.com/users/rgroothuis/gists{/gist_id}","starred_url":"https://api.github.com/users/rgroothuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgroothuis/subscriptions","organizations_url":"https://api.github.com/users/rgroothuis/orgs","repos_url":"https://api.github.com/users/rgroothuis/repos","events_url":"https://api.github.com/users/rgroothuis/events{/privacy}","received_events_url":"https://api.github.com/users/rgroothuis/received_events","type":"User","site_admin":false},"labels":[{"id":80622262,"url":"https://api.github.com/repos/clappr/clappr/labels/question","name":"question","color":"cc317c","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":7,"created_at":"2016-11-15T07:30:48Z","updated_at":"2016-11-15T20:18:46Z","closed_at":null,"body":"I've search the web but couldn't find a solution so that is why I'm posting it here. \r\n\r\nI'm using the clappr for 24/7 stream monitoring. After some time (randomly and i don't know the reason yet) the HLS streams stops or the Clappr stops playing the stream. How can I set it up so that it automatically reconnects to the stream and it starts playing automatically. \r\n\r\nWhen I refresh the Chrome browser in the above situation I immediately get a stream being played again. So the stream is still available. \r\n\r\nI was trying to use the onStop event but that doesn't work for me:\r\n\r\n    var player4 = new Clappr.Player({\r\n        events: {\r\n                onStop:  function() { alert(\"Stream Stopped\"); this.player4.play(); }\r\n        },      \r\n        source: \"http:/x.x.x.x/hdmistream01.m3u8\", \r\n        width: 320,\r\n        height: 180,\r\n        autoPlay: true,\r\n        actualLiveTime: true,   \r\n        parentId: \"#player4\"});\r\n\r\nLooking forward to some suggestions and solutions. \r\n\r\nThanks. "},"comment":{"url":"https://api.github.com/repos/clappr/clappr/issues/comments/260755374","html_url":"https://github.com/clappr/clappr/issues/1216#issuecomment-260755374","issue_url":"https://api.github.com/repos/clappr/clappr/issues/1216","id":260755374,"user":{"login":"rgroothuis","id":14161204,"avatar_url":"https://avatars.githubusercontent.com/u/14161204?v=3","gravatar_id":"","url":"https://api.github.com/users/rgroothuis","html_url":"https://github.com/rgroothuis","followers_url":"https://api.github.com/users/rgroothuis/followers","following_url":"https://api.github.com/users/rgroothuis/following{/other_user}","gists_url":"https://api.github.com/users/rgroothuis/gists{/gist_id}","starred_url":"https://api.github.com/users/rgroothuis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rgroothuis/subscriptions","organizations_url":"https://api.github.com/users/rgroothuis/orgs","repos_url":"https://api.github.com/users/rgroothuis/repos","events_url":"https://api.github.com/users/rgroothuis/events{/privacy}","received_events_url":"https://api.github.com/users/rgroothuis/received_events","type":"User","site_admin":false},"created_at":"2016-11-15T20:18:46Z","updated_at":"2016-11-15T20:18:46Z","body":"Debug has been enabled, I pressed the stop button. I see the messagebox popping up, this is good, but then the play() command is not working. Debug info:\r\n\r\n[debug][e] stop 0\r\nlog.js:67 [error][e] error on event stop trigger - TypeError: Cannot read property 'play' of undefined\r\n    at e.onStop (http://172.16.200.40/reneg/internal2.html:52:70)\r\n    at i (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:1:2590)\r\n    at p (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:1:2930)\r\n    at e.t.trigger (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:1:4151)\r\n    at e._onStop (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:4:26327)\r\n    at i (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:1:2534)\r\n    at p (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:1:2930)\r\n    at e.t.trigger (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:1:4151)\r\n    at e.stopped (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:3:16394)\r\n    at i (https://cdn.jsdelivr.net/clappr/latest/clappr.min.js:1:2534)\r\n\r\n\r\nThis is the code I'm using: \r\n\r\n    var player4 = new Clappr.Player({\r\n        events: {\r\n                onStop:  function() { alert(\"I am an alert box!\"); this.player4.play(); }\r\n        },      \r\n        source: \"http://x.x.x.x./hdmistream01.m3u8\", \r\n        width: 320,\r\n        height: 180,\r\n        autoPlay: true,\r\n        actualLiveTime: true,   \r\n        parentId: \"#player4\"});\r\n\r\nWhen using: \r\n                onStop:  function() { alert(\"I am an alert box!\"); player4.play(); }\r\n\r\n(removed the this before player4.play())\r\nI get the following debug info: \r\n\r\n[debug][Container] container:stats:report Object {startupTime: 437, rebuffers: 4, rebufferingTime: 359, watchingTime: 405, level: 0}\r\nlog.js:67 [debug][e] stop 0\r\nlog.js:67 [debug][hls] playback:play:intent\r\nlog.js:67 [debug][Container] container:mouseenter\r\n\r\nLooks lik the play command is working according to the debug screen but I do not get any streaming! This is the picture I get: \r\n\r\n<img width=\"329\" alt=\"screen shot 2016-11-15 at 21 17 52\" src=\"https://cloud.githubusercontent.com/assets/14161204/20322356/02a594d4-ab79-11e6-96dc-0b92762ac383.png\">\r\n\r\nAny suggestions what I'm doing wrong? \r\n"}}
{"actor":{"display_login":"rgroothuis"}}