{"action":"created","comment":{"url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/comments/325214133","pull_request_review_id":289323654,"id":325214133,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyNTIxNDEzMw==","diff_hunk":"@@ -520,49 +520,40 @@ SmallVideo.prototype.isVideoPlayable = function() {\n  * @return {number} one of <tt>DISPLAY_VIDEO</tt>,<tt>DISPLAY_AVATAR</tt>\n  * or <tt>DISPLAY_BLACKNESS_WITH_NAME</tt>.\n  */\n-SmallVideo.prototype.selectDisplayMode = function() {\n-    const isAudioOnly = APP.conference.isAudioOnly();\n-    const tileViewEnabled = shouldDisplayTileView(APP.store.getState());\n-    const isVideoPlayable = this.isVideoPlayable();\n-    const hasVideo = Boolean(this.selectVideoElement().length);\n+SmallVideo.prototype.selectDisplayMode = function(input) {\n \n     // Display name is always and only displayed when user is on the stage\n-    if (this.isCurrentlyOnLargeVideo() && !tileViewEnabled) {\n-        return isVideoPlayable && !isAudioOnly ? DISPLAY_BLACKNESS_WITH_NAME : DISPLAY_AVATAR_WITH_NAME;\n-    } else if (isVideoPlayable && hasVideo && !isAudioOnly) {\n+    if (input.isCurrentlyOnLargeVideo && !input.tileViewEnabled) {\n+        return input.isVideoPlayable && !input.isAudioOnly ? DISPLAY_BLACKNESS_WITH_NAME : DISPLAY_AVATAR_WITH_NAME;\n+    } else if (input.isVideoPlayable && input.hasVideo && !input.isAudioOnly) {\n         // check hovering and change state to video with name\n-        return this._isHovered() ? DISPLAY_VIDEO_WITH_NAME : DISPLAY_VIDEO;\n+        return input.isHovered ? DISPLAY_VIDEO_WITH_NAME : DISPLAY_VIDEO;\n     }\n \n     // check hovering and change state to avatar with name\n-    return this._isHovered() ? DISPLAY_AVATAR_WITH_NAME : DISPLAY_AVATAR;\n+    return input.isHovered ? DISPLAY_AVATAR_WITH_NAME : DISPLAY_AVATAR;\n };\n \n /**\n- * Prints information about the current display mode.\n+ * Computes information that determine the display mode.\n  *\n- * @param {string} mode - The current mode.\n- * @returns {void}\n- */\n-SmallVideo.prototype._printDisplayModeInfo = function(mode) {\n-    const isAudioOnly = APP.conference.isAudioOnly();\n-    const tileViewEnabled = shouldDisplayTileView(APP.store.getState());\n-    const isVideoPlayable = this.isVideoPlayable();\n-    const hasVideo = Boolean(this.selectVideoElement().length);\n-    const displayModeInfo = {\n-        isAudioOnly,\n-        tileViewEnabled,\n-        isVideoPlayable,\n-        hasVideo,\n+ * @returns {Object}\n+ */\n+SmallVideo.prototype.computeDisplayModeInput = function() {\n+    return {\n+        isCurrentlyOnLargeVideo: this.isCurrentlyOnLargeVideo(),\n+        isHovered: this._isHovered(),\n+        isAudioOnly: APP.conference.isAudioOnly(),","path":"modules/UI/videolayout/SmallVideo.js","position":60,"original_position":60,"commit_id":"d7176bb0e9b02edfbce957a7da671fbdd09c2708","original_commit_id":"d7176bb0e9b02edfbce957a7da671fbdd09c2708","user":{"login":"saghul","id":317464,"node_id":"MDQ6VXNlcjMxNzQ2NA==","avatar_url":"https://avatars0.githubusercontent.com/u/317464?v=4","gravatar_id":"","url":"https://api.github.com/users/saghul","html_url":"https://github.com/saghul","followers_url":"https://api.github.com/users/saghul/followers","following_url":"https://api.github.com/users/saghul/following{/other_user}","gists_url":"https://api.github.com/users/saghul/gists{/gist_id}","starred_url":"https://api.github.com/users/saghul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/saghul/subscriptions","organizations_url":"https://api.github.com/users/saghul/orgs","repos_url":"https://api.github.com/users/saghul/repos","events_url":"https://api.github.com/users/saghul/events{/privacy}","received_events_url":"https://api.github.com/users/saghul/received_events","type":"User","site_admin":false},"body":"We can now drop it from this object too?","created_at":"2019-09-17T14:51:14Z","updated_at":"2019-09-17T14:51:14Z","html_url":"https://github.com/jitsi/jitsi-meet/pull/4647#discussion_r325214133","pull_request_url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/comments/325214133"},"html":{"href":"https://github.com/jitsi/jitsi-meet/pull/4647#discussion_r325214133"},"pull_request":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647"}}},"pull_request":{"url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647","id":318333536,"node_id":"MDExOlB1bGxSZXF1ZXN0MzE4MzMzNTM2","html_url":"https://github.com/jitsi/jitsi-meet/pull/4647","diff_url":"https://github.com/jitsi/jitsi-meet/pull/4647.diff","patch_url":"https://github.com/jitsi/jitsi-meet/pull/4647.patch","issue_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues/4647","number":4647,"state":"open","locked":false,"title":"ref: Tweak logging logic for thumbnail display mode and tile view.","user":{"login":"gpolitis","id":642943,"node_id":"MDQ6VXNlcjY0Mjk0Mw==","avatar_url":"https://avatars0.githubusercontent.com/u/642943?v=4","gravatar_id":"","url":"https://api.github.com/users/gpolitis","html_url":"https://github.com/gpolitis","followers_url":"https://api.github.com/users/gpolitis/followers","following_url":"https://api.github.com/users/gpolitis/following{/other_user}","gists_url":"https://api.github.com/users/gpolitis/gists{/gist_id}","starred_url":"https://api.github.com/users/gpolitis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gpolitis/subscriptions","organizations_url":"https://api.github.com/users/gpolitis/orgs","repos_url":"https://api.github.com/users/gpolitis/repos","events_url":"https://api.github.com/users/gpolitis/events{/privacy}","received_events_url":"https://api.github.com/users/gpolitis/received_events","type":"User","site_admin":false},"body":"This PR slightly refactors the display mode logging logic. While debugging a broken call I've noticed this state being printed in the JS console logs:\r\n\r\n```json\r\n{\r\n  \"isAudioOnly\": false,\r\n  \"tileViewEnabled\": true,\r\n  \"isVideoPlayable\": false,\r\n  \"hasVideo\": true,\r\n  \"connectionStatus\": \"active\",\r\n  \"mutedWhileDisconnected\": false,\r\n  \"wasVideoPlayed\": false,\r\n  \"videoStream\": true,\r\n  \"isVideoMuted\": false,\r\n  \"videoStreamMuted\": false\r\n}\r\n```\r\n\r\nLooking at how the `isVideoPlayable` flag is computed in SmallVideo.js the above state is impossible: `isVideoPlayable` is computed as `videoStream && !isVideoMuted && !videoStreamMuted`, so, in this particular case, it owed to be `true`; yet, it is computed as `false`.\r\n\r\nIn this PR I'm not attempting to fix the issue because I don't know how it's possible to end-up in this particular situation. In this PR I am modifying the code in an effort to help me understand what could be the problem: I compute the state once, store it in a variable and use that particular state variable to compute the display mode and print the diagnostic message, instead of computing the display mode and then re-building the state object to print it.","created_at":"2019-09-17T13:14:00Z","updated_at":"2019-09-17T14:51:14Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e7ec0995750bc855917c6ef668b97b997d4305c4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647/commits","review_comments_url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647/comments","review_comment_url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues/4647/comments","statuses_url":"https://api.github.com/repos/jitsi/jitsi-meet/statuses/d7176bb0e9b02edfbce957a7da671fbdd09c2708","head":{"label":"jitsi:ref-display-mode-logging-logic","ref":"ref-display-mode-logging-logic","sha":"d7176bb0e9b02edfbce957a7da671fbdd09c2708","user":{"login":"jitsi","id":3671647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NzE2NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/3671647?v=4","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"repo":{"id":15225670,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyNTY3MA==","name":"jitsi-meet","full_name":"jitsi/jitsi-meet","private":false,"owner":{"login":"jitsi","id":3671647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NzE2NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/3671647?v=4","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jitsi/jitsi-meet","description":"Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.","fork":false,"url":"https://api.github.com/repos/jitsi/jitsi-meet","forks_url":"https://api.github.com/repos/jitsi/jitsi-meet/forks","keys_url":"https://api.github.com/repos/jitsi/jitsi-meet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jitsi/jitsi-meet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jitsi/jitsi-meet/teams","hooks_url":"https://api.github.com/repos/jitsi/jitsi-meet/hooks","issue_events_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues/events{/number}","events_url":"https://api.github.com/repos/jitsi/jitsi-meet/events","assignees_url":"https://api.github.com/repos/jitsi/jitsi-meet/assignees{/user}","branches_url":"https://api.github.com/repos/jitsi/jitsi-meet/branches{/branch}","tags_url":"https://api.github.com/repos/jitsi/jitsi-meet/tags","blobs_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/refs{/sha}","trees_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jitsi/jitsi-meet/statuses/{sha}","languages_url":"https://api.github.com/repos/jitsi/jitsi-meet/languages","stargazers_url":"https://api.github.com/repos/jitsi/jitsi-meet/stargazers","contributors_url":"https://api.github.com/repos/jitsi/jitsi-meet/contributors","subscribers_url":"https://api.github.com/repos/jitsi/jitsi-meet/subscribers","subscription_url":"https://api.github.com/repos/jitsi/jitsi-meet/subscription","commits_url":"https://api.github.com/repos/jitsi/jitsi-meet/commits{/sha}","git_commits_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/commits{/sha}","comments_url":"https://api.github.com/repos/jitsi/jitsi-meet/comments{/number}","issue_comment_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues/comments{/number}","contents_url":"https://api.github.com/repos/jitsi/jitsi-meet/contents/{+path}","compare_url":"https://api.github.com/repos/jitsi/jitsi-meet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jitsi/jitsi-meet/merges","archive_url":"https://api.github.com/repos/jitsi/jitsi-meet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jitsi/jitsi-meet/downloads","issues_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues{/number}","pulls_url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls{/number}","milestones_url":"https://api.github.com/repos/jitsi/jitsi-meet/milestones{/number}","notifications_url":"https://api.github.com/repos/jitsi/jitsi-meet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jitsi/jitsi-meet/labels{/name}","releases_url":"https://api.github.com/repos/jitsi/jitsi-meet/releases{/id}","deployments_url":"https://api.github.com/repos/jitsi/jitsi-meet/deployments","created_at":"2013-12-16T12:51:09Z","updated_at":"2019-09-17T11:42:11Z","pushed_at":"2019-09-17T14:39:55Z","git_url":"git://github.com/jitsi/jitsi-meet.git","ssh_url":"git@github.com:jitsi/jitsi-meet.git","clone_url":"https://github.com/jitsi/jitsi-meet.git","svn_url":"https://github.com/jitsi/jitsi-meet","homepage":"https://jitsi.org/meet","size":37294,"stargazers_count":4187,"watchers_count":4187,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1409,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":75,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1409,"open_issues":75,"watchers":4187,"default_branch":"master"}},"base":{"label":"jitsi:master","ref":"master","sha":"00c8409e31581ce17788734b8c8704bfb7d9c47e","user":{"login":"jitsi","id":3671647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NzE2NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/3671647?v=4","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"repo":{"id":15225670,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyNTY3MA==","name":"jitsi-meet","full_name":"jitsi/jitsi-meet","private":false,"owner":{"login":"jitsi","id":3671647,"node_id":"MDEyOk9yZ2FuaXphdGlvbjM2NzE2NDc=","avatar_url":"https://avatars2.githubusercontent.com/u/3671647?v=4","gravatar_id":"","url":"https://api.github.com/users/jitsi","html_url":"https://github.com/jitsi","followers_url":"https://api.github.com/users/jitsi/followers","following_url":"https://api.github.com/users/jitsi/following{/other_user}","gists_url":"https://api.github.com/users/jitsi/gists{/gist_id}","starred_url":"https://api.github.com/users/jitsi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jitsi/subscriptions","organizations_url":"https://api.github.com/users/jitsi/orgs","repos_url":"https://api.github.com/users/jitsi/repos","events_url":"https://api.github.com/users/jitsi/events{/privacy}","received_events_url":"https://api.github.com/users/jitsi/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/jitsi/jitsi-meet","description":"Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.","fork":false,"url":"https://api.github.com/repos/jitsi/jitsi-meet","forks_url":"https://api.github.com/repos/jitsi/jitsi-meet/forks","keys_url":"https://api.github.com/repos/jitsi/jitsi-meet/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jitsi/jitsi-meet/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jitsi/jitsi-meet/teams","hooks_url":"https://api.github.com/repos/jitsi/jitsi-meet/hooks","issue_events_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues/events{/number}","events_url":"https://api.github.com/repos/jitsi/jitsi-meet/events","assignees_url":"https://api.github.com/repos/jitsi/jitsi-meet/assignees{/user}","branches_url":"https://api.github.com/repos/jitsi/jitsi-meet/branches{/branch}","tags_url":"https://api.github.com/repos/jitsi/jitsi-meet/tags","blobs_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/refs{/sha}","trees_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jitsi/jitsi-meet/statuses/{sha}","languages_url":"https://api.github.com/repos/jitsi/jitsi-meet/languages","stargazers_url":"https://api.github.com/repos/jitsi/jitsi-meet/stargazers","contributors_url":"https://api.github.com/repos/jitsi/jitsi-meet/contributors","subscribers_url":"https://api.github.com/repos/jitsi/jitsi-meet/subscribers","subscription_url":"https://api.github.com/repos/jitsi/jitsi-meet/subscription","commits_url":"https://api.github.com/repos/jitsi/jitsi-meet/commits{/sha}","git_commits_url":"https://api.github.com/repos/jitsi/jitsi-meet/git/commits{/sha}","comments_url":"https://api.github.com/repos/jitsi/jitsi-meet/comments{/number}","issue_comment_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues/comments{/number}","contents_url":"https://api.github.com/repos/jitsi/jitsi-meet/contents/{+path}","compare_url":"https://api.github.com/repos/jitsi/jitsi-meet/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jitsi/jitsi-meet/merges","archive_url":"https://api.github.com/repos/jitsi/jitsi-meet/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jitsi/jitsi-meet/downloads","issues_url":"https://api.github.com/repos/jitsi/jitsi-meet/issues{/number}","pulls_url":"https://api.github.com/repos/jitsi/jitsi-meet/pulls{/number}","milestones_url":"https://api.github.com/repos/jitsi/jitsi-meet/milestones{/number}","notifications_url":"https://api.github.com/repos/jitsi/jitsi-meet/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jitsi/jitsi-meet/labels{/name}","releases_url":"https://api.github.com/repos/jitsi/jitsi-meet/releases{/id}","deployments_url":"https://api.github.com/repos/jitsi/jitsi-meet/deployments","created_at":"2013-12-16T12:51:09Z","updated_at":"2019-09-17T11:42:11Z","pushed_at":"2019-09-17T14:39:55Z","git_url":"git://github.com/jitsi/jitsi-meet.git","ssh_url":"git@github.com:jitsi/jitsi-meet.git","clone_url":"https://github.com/jitsi/jitsi-meet.git","svn_url":"https://github.com/jitsi/jitsi-meet","homepage":"https://jitsi.org/meet","size":37294,"stargazers_count":4187,"watchers_count":4187,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1409,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":75,"license":{"key":"apache-2.0","name":"Apache License 2.0","spdx_id":"Apache-2.0","url":"https://api.github.com/licenses/apache-2.0","node_id":"MDc6TGljZW5zZTI="},"forks":1409,"open_issues":75,"watchers":4187,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647"},"html":{"href":"https://github.com/jitsi/jitsi-meet/pull/4647"},"issue":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/issues/4647"},"comments":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/issues/4647/comments"},"review_comments":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647/comments"},"review_comment":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/pulls/4647/commits"},"statuses":{"href":"https://api.github.com/repos/jitsi/jitsi-meet/statuses/d7176bb0e9b02edfbce957a7da671fbdd09c2708"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"saghul"}}