{"action":"created","comment":{"url":"https://api.github.com/repos/videojs/video.js/pulls/comments/192833900","pull_request_review_id":125685436,"id":192833900,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDE5MjgzMzkwMA==","diff_hunk":"@@ -2747,22 +2803,53 @@ class Player extends Component {\n   }\n \n   /**\n-   * Get or set the autoplay attribute.\n+   * Get or set the autoplay option. When this is a boolean it will\n+   * modify the attribute on the tech. When this is a string the attribute on\n+   * the tech will be removed and `Player` will handle autoplay on loadstarts.\n    *\n-   * @param {boolean} [value]\n-   *        - true means that we should autoplay\n-   *        - false means that we should not autoplay\n+   * @param {boolean|string} [value]\n+   *        - true: autoplay using the browser behavior\n+   *        - false: do not autoplay\n+   *        - 'play': call play() on every loadstart\n+   *        - 'muted': call muted() then play() on every loadstart\n+   *        - 'any': call play() on every loadstart. if that fails call muted() then play().\n+   *        - *: values other than those listed here will be set `autoplay` to true\n    *\n-   * @return {string}\n+   * @return {boolean|string}\n    *         The current value of autoplay when getting\n    */\n   autoplay(value) {\n-    if (value !== undefined) {\n-      this.techCall_('setAutoplay', value);\n+    // getter usage\n+    if (value === undefined) {\n+      return this.options_.autoplay || false;\n+    }\n+\n+    let techAutoplay;\n+\n+    // if the value is a valid string set it to that\n+    if (typeof value === 'string' && (/(any|play|muted)/).test(value)) {","path":"src/js/player.js","position":120,"original_position":120,"commit_id":"794c98488665d4dc6fb9f4b52cdb1223e9289b87","original_commit_id":"794c98488665d4dc6fb9f4b52cdb1223e9289b87","user":{"login":"gkatsev","id":535884,"node_id":"MDQ6VXNlcjUzNTg4NA==","avatar_url":"https://avatars0.githubusercontent.com/u/535884?v=4","gravatar_id":"","url":"https://api.github.com/users/gkatsev","html_url":"https://github.com/gkatsev","followers_url":"https://api.github.com/users/gkatsev/followers","following_url":"https://api.github.com/users/gkatsev/following{/other_user}","gists_url":"https://api.github.com/users/gkatsev/gists{/gist_id}","starred_url":"https://api.github.com/users/gkatsev/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gkatsev/subscriptions","organizations_url":"https://api.github.com/users/gkatsev/orgs","repos_url":"https://api.github.com/users/gkatsev/repos","events_url":"https://api.github.com/users/gkatsev/events{/privacy}","received_events_url":"https://api.github.com/users/gkatsev/received_events","type":"User","site_admin":false},"body":"should we call `this.manualAutoplay_` in here? Use case would be something like:\r\n```js\r\nvar player = videojs('vid');\r\n\r\nplayer.autoplay('any');\r\n```\r\nI'd expect the player to autoplay in this case. This would also match current behavior (in browsers that support autoplay). Main risk is that we'd want to be able to do something like the following too\r\n```js\r\nvar player = videojs('vid', { autoplay: 'any' );\r\n\r\nplayer.autoplay(false);\r\n```\r\nand have it not autoplay.\r\n\r\nAlso, should we have a string state \"off\" and deprecate boolean values for it?","created_at":"2018-06-04T18:15:27Z","updated_at":"2018-06-04T18:16:09Z","html_url":"https://github.com/videojs/video.js/pull/5209#discussion_r192833900","pull_request_url":"https://api.github.com/repos/videojs/video.js/pulls/5209","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/videojs/video.js/pulls/comments/192833900"},"html":{"href":"https://github.com/videojs/video.js/pull/5209#discussion_r192833900"},"pull_request":{"href":"https://api.github.com/repos/videojs/video.js/pulls/5209"}}},"pull_request":{"url":"https://api.github.com/repos/videojs/video.js/pulls/5209","id":190408821,"node_id":"MDExOlB1bGxSZXF1ZXN0MTkwNDA4ODIx","html_url":"https://github.com/videojs/video.js/pull/5209","diff_url":"https://github.com/videojs/video.js/pull/5209.diff","patch_url":"https://github.com/videojs/video.js/pull/5209.patch","issue_url":"https://api.github.com/repos/videojs/video.js/issues/5209","number":5209,"state":"open","locked":false,"title":"feat: manual autoplay","user":{"login":"BrandonOCasey","id":2381475,"node_id":"MDQ6VXNlcjIzODE0NzU=","avatar_url":"https://avatars0.githubusercontent.com/u/2381475?v=4","gravatar_id":"","url":"https://api.github.com/users/BrandonOCasey","html_url":"https://github.com/BrandonOCasey","followers_url":"https://api.github.com/users/BrandonOCasey/followers","following_url":"https://api.github.com/users/BrandonOCasey/following{/other_user}","gists_url":"https://api.github.com/users/BrandonOCasey/gists{/gist_id}","starred_url":"https://api.github.com/users/BrandonOCasey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BrandonOCasey/subscriptions","organizations_url":"https://api.github.com/users/BrandonOCasey/orgs","repos_url":"https://api.github.com/users/BrandonOCasey/repos","events_url":"https://api.github.com/users/BrandonOCasey/events{/privacy}","received_events_url":"https://api.github.com/users/BrandonOCasey/received_events","type":"User","site_admin":false},"body":"Due to some of the policy changes around autoplay we are going to add a new option. The name of the option and the parameters that the option can be can change in this pr, but I think the general functionality is going to remain the same. Basically you have three paths\r\n\r\n1. Try to autoplay using `play` and if that doesn't work do nothing, mostly the same as using the `autoplay` attribute right now.\r\n2. Try to mute and then autoplay using `play`, this will work in most cases\r\n3. Try to autoplay using `play` and if that doesnt work try to mute and then autoplay, which we know will work.\r\n\r\nQuestions:\r\n* Should we remove option 2 and just recommending using autoplay in that case?\r\n* Should we default to using option 3?\r\n* Should we just use the `autoplay` attribute and accept a string?\r\n\r\nComing Soon\r\n* Tests\r\n* Documentation updates","created_at":"2018-05-24T20:21:11Z","updated_at":"2018-06-04T18:16:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"afed86e0090ceb8eed56c4bbd7998fc0bbf2e2a2","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/videojs/video.js/pulls/5209/commits","review_comments_url":"https://api.github.com/repos/videojs/video.js/pulls/5209/comments","review_comment_url":"https://api.github.com/repos/videojs/video.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/videojs/video.js/issues/5209/comments","statuses_url":"https://api.github.com/repos/videojs/video.js/statuses/794c98488665d4dc6fb9f4b52cdb1223e9289b87","head":{"label":"videojs:feat/manual-autoplay","ref":"feat/manual-autoplay","sha":"794c98488665d4dc6fb9f4b52cdb1223e9289b87","user":{"login":"videojs","id":3287189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODcxODk=","avatar_url":"https://avatars2.githubusercontent.com/u/3287189?v=4","gravatar_id":"","url":"https://api.github.com/users/videojs","html_url":"https://github.com/videojs","followers_url":"https://api.github.com/users/videojs/followers","following_url":"https://api.github.com/users/videojs/following{/other_user}","gists_url":"https://api.github.com/users/videojs/gists{/gist_id}","starred_url":"https://api.github.com/users/videojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videojs/subscriptions","organizations_url":"https://api.github.com/users/videojs/orgs","repos_url":"https://api.github.com/users/videojs/repos","events_url":"https://api.github.com/users/videojs/events{/privacy}","received_events_url":"https://api.github.com/users/videojs/received_events","type":"Organization","site_admin":false},"repo":{"id":667006,"node_id":"MDEwOlJlcG9zaXRvcnk2NjcwMDY=","name":"video.js","full_name":"videojs/video.js","owner":{"login":"videojs","id":3287189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODcxODk=","avatar_url":"https://avatars2.githubusercontent.com/u/3287189?v=4","gravatar_id":"","url":"https://api.github.com/users/videojs","html_url":"https://github.com/videojs","followers_url":"https://api.github.com/users/videojs/followers","following_url":"https://api.github.com/users/videojs/following{/other_user}","gists_url":"https://api.github.com/users/videojs/gists{/gist_id}","starred_url":"https://api.github.com/users/videojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videojs/subscriptions","organizations_url":"https://api.github.com/users/videojs/orgs","repos_url":"https://api.github.com/users/videojs/repos","events_url":"https://api.github.com/users/videojs/events{/privacy}","received_events_url":"https://api.github.com/users/videojs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/videojs/video.js","description":"Video.js - open source HTML5 & Flash video player","fork":false,"url":"https://api.github.com/repos/videojs/video.js","forks_url":"https://api.github.com/repos/videojs/video.js/forks","keys_url":"https://api.github.com/repos/videojs/video.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videojs/video.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videojs/video.js/teams","hooks_url":"https://api.github.com/repos/videojs/video.js/hooks","issue_events_url":"https://api.github.com/repos/videojs/video.js/issues/events{/number}","events_url":"https://api.github.com/repos/videojs/video.js/events","assignees_url":"https://api.github.com/repos/videojs/video.js/assignees{/user}","branches_url":"https://api.github.com/repos/videojs/video.js/branches{/branch}","tags_url":"https://api.github.com/repos/videojs/video.js/tags","blobs_url":"https://api.github.com/repos/videojs/video.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videojs/video.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videojs/video.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/videojs/video.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videojs/video.js/statuses/{sha}","languages_url":"https://api.github.com/repos/videojs/video.js/languages","stargazers_url":"https://api.github.com/repos/videojs/video.js/stargazers","contributors_url":"https://api.github.com/repos/videojs/video.js/contributors","subscribers_url":"https://api.github.com/repos/videojs/video.js/subscribers","subscription_url":"https://api.github.com/repos/videojs/video.js/subscription","commits_url":"https://api.github.com/repos/videojs/video.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/videojs/video.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/videojs/video.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/videojs/video.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/videojs/video.js/contents/{+path}","compare_url":"https://api.github.com/repos/videojs/video.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videojs/video.js/merges","archive_url":"https://api.github.com/repos/videojs/video.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videojs/video.js/downloads","issues_url":"https://api.github.com/repos/videojs/video.js/issues{/number}","pulls_url":"https://api.github.com/repos/videojs/video.js/pulls{/number}","milestones_url":"https://api.github.com/repos/videojs/video.js/milestones{/number}","notifications_url":"https://api.github.com/repos/videojs/video.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videojs/video.js/labels{/name}","releases_url":"https://api.github.com/repos/videojs/video.js/releases{/id}","deployments_url":"https://api.github.com/repos/videojs/video.js/deployments","created_at":"2010-05-14T18:45:10Z","updated_at":"2018-06-04T17:11:46Z","pushed_at":"2018-06-04T15:14:35Z","git_url":"git://github.com/videojs/video.js.git","ssh_url":"git@github.com:videojs/video.js.git","clone_url":"https://github.com/videojs/video.js.git","svn_url":"https://github.com/videojs/video.js","homepage":"www.videojs.com","size":117116,"stargazers_count":21427,"watchers_count":21427,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":5480,"mirror_url":null,"archived":false,"open_issues_count":265,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5480,"open_issues":265,"watchers":21427,"default_branch":"master"}},"base":{"label":"videojs:master","ref":"master","sha":"702acdb6a19d8d2d1ca80f851729c5bcb25847d2","user":{"login":"videojs","id":3287189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODcxODk=","avatar_url":"https://avatars2.githubusercontent.com/u/3287189?v=4","gravatar_id":"","url":"https://api.github.com/users/videojs","html_url":"https://github.com/videojs","followers_url":"https://api.github.com/users/videojs/followers","following_url":"https://api.github.com/users/videojs/following{/other_user}","gists_url":"https://api.github.com/users/videojs/gists{/gist_id}","starred_url":"https://api.github.com/users/videojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videojs/subscriptions","organizations_url":"https://api.github.com/users/videojs/orgs","repos_url":"https://api.github.com/users/videojs/repos","events_url":"https://api.github.com/users/videojs/events{/privacy}","received_events_url":"https://api.github.com/users/videojs/received_events","type":"Organization","site_admin":false},"repo":{"id":667006,"node_id":"MDEwOlJlcG9zaXRvcnk2NjcwMDY=","name":"video.js","full_name":"videojs/video.js","owner":{"login":"videojs","id":3287189,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODcxODk=","avatar_url":"https://avatars2.githubusercontent.com/u/3287189?v=4","gravatar_id":"","url":"https://api.github.com/users/videojs","html_url":"https://github.com/videojs","followers_url":"https://api.github.com/users/videojs/followers","following_url":"https://api.github.com/users/videojs/following{/other_user}","gists_url":"https://api.github.com/users/videojs/gists{/gist_id}","starred_url":"https://api.github.com/users/videojs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/videojs/subscriptions","organizations_url":"https://api.github.com/users/videojs/orgs","repos_url":"https://api.github.com/users/videojs/repos","events_url":"https://api.github.com/users/videojs/events{/privacy}","received_events_url":"https://api.github.com/users/videojs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/videojs/video.js","description":"Video.js - open source HTML5 & Flash video player","fork":false,"url":"https://api.github.com/repos/videojs/video.js","forks_url":"https://api.github.com/repos/videojs/video.js/forks","keys_url":"https://api.github.com/repos/videojs/video.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/videojs/video.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/videojs/video.js/teams","hooks_url":"https://api.github.com/repos/videojs/video.js/hooks","issue_events_url":"https://api.github.com/repos/videojs/video.js/issues/events{/number}","events_url":"https://api.github.com/repos/videojs/video.js/events","assignees_url":"https://api.github.com/repos/videojs/video.js/assignees{/user}","branches_url":"https://api.github.com/repos/videojs/video.js/branches{/branch}","tags_url":"https://api.github.com/repos/videojs/video.js/tags","blobs_url":"https://api.github.com/repos/videojs/video.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/videojs/video.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/videojs/video.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/videojs/video.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/videojs/video.js/statuses/{sha}","languages_url":"https://api.github.com/repos/videojs/video.js/languages","stargazers_url":"https://api.github.com/repos/videojs/video.js/stargazers","contributors_url":"https://api.github.com/repos/videojs/video.js/contributors","subscribers_url":"https://api.github.com/repos/videojs/video.js/subscribers","subscription_url":"https://api.github.com/repos/videojs/video.js/subscription","commits_url":"https://api.github.com/repos/videojs/video.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/videojs/video.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/videojs/video.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/videojs/video.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/videojs/video.js/contents/{+path}","compare_url":"https://api.github.com/repos/videojs/video.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/videojs/video.js/merges","archive_url":"https://api.github.com/repos/videojs/video.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/videojs/video.js/downloads","issues_url":"https://api.github.com/repos/videojs/video.js/issues{/number}","pulls_url":"https://api.github.com/repos/videojs/video.js/pulls{/number}","milestones_url":"https://api.github.com/repos/videojs/video.js/milestones{/number}","notifications_url":"https://api.github.com/repos/videojs/video.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/videojs/video.js/labels{/name}","releases_url":"https://api.github.com/repos/videojs/video.js/releases{/id}","deployments_url":"https://api.github.com/repos/videojs/video.js/deployments","created_at":"2010-05-14T18:45:10Z","updated_at":"2018-06-04T17:11:46Z","pushed_at":"2018-06-04T15:14:35Z","git_url":"git://github.com/videojs/video.js.git","ssh_url":"git@github.com:videojs/video.js.git","clone_url":"https://github.com/videojs/video.js.git","svn_url":"https://github.com/videojs/video.js","homepage":"www.videojs.com","size":117116,"stargazers_count":21427,"watchers_count":21427,"language":"JavaScript","has_issues":true,"has_projects":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":5480,"mirror_url":null,"archived":false,"open_issues_count":265,"license":{"key":"other","name":"Other","spdx_id":null,"url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":5480,"open_issues":265,"watchers":21427,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videojs/video.js/pulls/5209"},"html":{"href":"https://github.com/videojs/video.js/pull/5209"},"issue":{"href":"https://api.github.com/repos/videojs/video.js/issues/5209"},"comments":{"href":"https://api.github.com/repos/videojs/video.js/issues/5209/comments"},"review_comments":{"href":"https://api.github.com/repos/videojs/video.js/pulls/5209/comments"},"review_comment":{"href":"https://api.github.com/repos/videojs/video.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/videojs/video.js/pulls/5209/commits"},"statuses":{"href":"https://api.github.com/repos/videojs/video.js/statuses/794c98488665d4dc6fb9f4b52cdb1223e9289b87"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"gkatsev"}}