{"action":"created","issue":{"url":"https://api.github.com/repos/meetecho/janus-gateway/issues/172","labels_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/172/labels{/name}","comments_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/172/comments","events_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/172/events","html_url":"https://github.com/meetecho/janus-gateway/pull/172","id":60065737,"number":172,"title":"Fix videoremote id for spinner","user":{"login":"LetsVape","id":10448199,"avatar_url":"https://avatars.githubusercontent.com/u/10448199?v=3","gravatar_id":"","url":"https://api.github.com/users/LetsVape","html_url":"https://github.com/LetsVape","followers_url":"https://api.github.com/users/LetsVape/followers","following_url":"https://api.github.com/users/LetsVape/following{/other_user}","gists_url":"https://api.github.com/users/LetsVape/gists{/gist_id}","starred_url":"https://api.github.com/users/LetsVape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LetsVape/subscriptions","organizations_url":"https://api.github.com/users/LetsVape/orgs","repos_url":"https://api.github.com/users/LetsVape/repos","events_url":"https://api.github.com/users/LetsVape/events{/privacy}","received_events_url":"https://api.github.com/users/LetsVape/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-03-06T06:39:13Z","updated_at":"2015-03-06T07:03:41Z","closed_at":"2015-03-06T06:57:38Z","pull_request":{"url":"https://api.github.com/repos/meetecho/janus-gateway/pulls/172","html_url":"https://github.com/meetecho/janus-gateway/pull/172","diff_url":"https://github.com/meetecho/janus-gateway/pull/172.diff","patch_url":"https://github.com/meetecho/janus-gateway/pull/172.patch"},"body":"The spinner wasn't working because the getElementById selecter included #\r\n\r\nI also included anoteher change in my own UI which you might want to utilize or maybe there's a better way of getting a callback to disable this spinner?\r\n\r\nAt the moment the spinner is stopped whenever the video element is created, but when it is it could still take a while for the connection to be established and until that time the video element will be black.\r\n\r\nTo keep the spinner going until the video actually shows video I changed the code which adds the bitrate label to the following;\r\n```javascript\r\n\t\t\t\t\tif(webrtcDetectedBrowser == \"chrome\") {\r\n\t\t\t\t\t\tspinstopTimer[remoteFeed.rfindex] = setInterval(function() {\r\n\t\t\t\t\t\tif(remoteFeed.webrtcStuff==undefined){\r\n\t\t\t\t\t\t\t//if the remotefeed was cleared before it reached bitr > 0 clear it so it doesn't overlay another cam\r\n\t\t\t\t\t\t\tremoteFeed.spinner.stop();\r\n\t\t\t\t\t\t\tspinStopped[remoteFeed.rfindex]=true;\r\n\t\t\t\t\t\t\tclearInterval(spinstopTimer[remoteFeed.rfindex]);\r\n\t\t\t\t\t\t\tspinstopTimer[remoteFeed.rfindex] = null;\r\n\t\t\t\t\t\t} else {\r\n\t\t\t\t\t\tvar bitrate = remoteFeed.getBitrate();\r\n\t\t\t\t\t\tvar bitr = parseInt(bitrate);\r\n\t\t\t\t\t\t\tif(spinStopped[remoteFeed.rfindex]==false){\r\n\t\t\t\t\t\t\t\tif(bitr>0){\r\n\t\t\t\t\t\t\t\t\t//Stop the spinner when the bitrate gets over 0\r\n\t\t\t\t\t\t\t\t\tif(remoteFeed.spinner !== undefined && remoteFeed.spinner !== null){\r\n\t\t\t\t\t\t\t\t\t\tremoteFeed.spinner.stop();\r\n\t\t\t\t\t\t\t\t\t\tspinStopped[remoteFeed.rfindex]=true;\r\n\t\t\t\t\t\t\t\t\t\tclearInterval(spinstopTimer[remoteFeed.rfindex]);\r\n\t\t\t\t\t\t\t\t\t\tspinstopTimer[remoteFeed.rfindex] = null;\r\n\t\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}, 250);\r\n\r\n\t\t\t\t\t\t$('#curbitrate'+remoteFeed.rfindex).removeClass('hide').show();\r\n\t\t\t\t\t\t\tbitrateTimer[remoteFeed.rfindex] = setInterval(function() {\r\n\t\t\t\t\t\t\t// Display updated bitrate, if supported\r\n\t\t\t\t\t\t\tvar bitrate = remoteFeed.getBitrate();\r\n\t\t\t\t\t\t\t$('#curbitrate'+remoteFeed.rfindex).text(bitrate);\r\n\t\t\t\t\t\t}, 1000);\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t//Stop the spinner in non-chrome browsers which don't support getBitrate();\r\n\t\t\t\t\tremoteFeed.spinner.stop();\r\n\t\t\t\t\t}\r\n```\r\n\r\nAnd I commented out \r\n```javascript\r\n\t\t\t\tif(remoteFeed.spinner !== undefined && remoteFeed.spinner !== null)\r\n\t\t\t\t\tremoteFeed.spinner.stop();\r\n```\r\n\r\nNow as this is using a counter to check the bitrate label and only works in Chrome it's not the most efficient, is there a callback that is received when the video actually starts?\r\n\r\nThanks\r\n"},"comment":{"url":"https://api.github.com/repos/meetecho/janus-gateway/issues/comments/77516043","html_url":"https://github.com/meetecho/janus-gateway/pull/172#issuecomment-77516043","issue_url":"https://api.github.com/repos/meetecho/janus-gateway/issues/172","id":77516043,"user":{"login":"LetsVape","id":10448199,"avatar_url":"https://avatars.githubusercontent.com/u/10448199?v=3","gravatar_id":"","url":"https://api.github.com/users/LetsVape","html_url":"https://github.com/LetsVape","followers_url":"https://api.github.com/users/LetsVape/followers","following_url":"https://api.github.com/users/LetsVape/following{/other_user}","gists_url":"https://api.github.com/users/LetsVape/gists{/gist_id}","starred_url":"https://api.github.com/users/LetsVape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LetsVape/subscriptions","organizations_url":"https://api.github.com/users/LetsVape/orgs","repos_url":"https://api.github.com/users/LetsVape/repos","events_url":"https://api.github.com/users/LetsVape/events{/privacy}","received_events_url":"https://api.github.com/users/LetsVape/received_events","type":"User","site_admin":false},"created_at":"2015-03-06T07:03:41Z","updated_at":"2015-03-06T07:03:41Z","body":"No worries, glad I could contribute a little bit in return at least, hope to get more familiar with the server-side code to get more involved in fixing bugs.\r\n\r\nThanks for your explanation on how to programatically check for the video state without relying on the bitrate counter, I'll spend some time on that to see if I can get it working for the non-chrome users too as this indeed is just a workaround not a proper fix."}}