{"action":"created","comment":{"url":"https://api.github.com/repos/videojs/video.js/pulls/comments/27082952","id":27082952,"diff_hunk":"@@ -849,3 +849,25 @@ vjs.arr.forEach = function(array, callback, thisArg) {\n \n   return array;\n };\n+\n+/**\n+ * Returns the extension of the passed file name. It will return an empty string if you pass an invalid path\n+ *\n+ * @param {String}    path    The fileName path like '/path/to/file.mp4'\n+ * @returns {String}          The extension in lower case or an empty string if no extension could be found.\n+ */\n+vjs.getFileExtension = function(path) {\n+  var splitPathRe;\n+  var pathParts;\n+\n+  if(typeof path === 'string'){\n+    splitPathRe = /^(\\/?)([\\s\\S]*?)((?:\\.{1,2}|[^\\/]+?)(\\.([^\\.\\/\\?]+)))(?:[\\/]*|[\\?].*)$/i;","path":"src/js/lib.js","position":16,"original_position":16,"commit_id":"213c23d097963b072a9e52271f21b930b6729d21","original_commit_id":"213c23d097963b072a9e52271f21b930b6729d21","user":{"login":"heff","id":166,"avatar_url":"https://avatars.githubusercontent.com/u/166?v=3","gravatar_id":"","url":"https://api.github.com/users/heff","html_url":"https://github.com/heff","followers_url":"https://api.github.com/users/heff/followers","following_url":"https://api.github.com/users/heff/following{/other_user}","gists_url":"https://api.github.com/users/heff/gists{/gist_id}","starred_url":"https://api.github.com/users/heff/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/heff/subscriptions","organizations_url":"https://api.github.com/users/heff/orgs","repos_url":"https://api.github.com/users/heff/repos","events_url":"https://api.github.com/users/heff/events{/privacy}","received_events_url":"https://api.github.com/users/heff/received_events","type":"User","site_admin":false},"body":"That's a pretty advanced regex. What does it add over the one that was in the html5 tech?","created_at":"2015-03-24T23:15:29Z","updated_at":"2015-03-24T23:15:29Z","html_url":"https://github.com/videojs/video.js/pull/1974#discussion_r27082952","pull_request_url":"https://api.github.com/repos/videojs/video.js/pulls/1974","_links":{"self":{"href":"https://api.github.com/repos/videojs/video.js/pulls/comments/27082952"},"html":{"href":"https://github.com/videojs/video.js/pull/1974#discussion_r27082952"},"pull_request":{"href":"https://api.github.com/repos/videojs/video.js/pulls/1974"}}},"pull_request":{"url":"https://api.github.com/repos/videojs/video.js/pulls/1974","id":31859216,"html_url":"https://github.com/videojs/video.js/pull/1974","diff_url":"https://github.com/videojs/video.js/pull/1974.diff","patch_url":"https://github.com/videojs/video.js/pull/1974.patch","issue_url":"https://api.github.com/repos/videojs/video.js/issues/1974","number":1974,"state":"open","locked":false,"title":"Extended canHandleSource in media files to consistently guess mime types. Fixes #1833","user":{"login":"carpasse","id":1588321,"avatar_url":"https://avatars.githubusercontent.com/u/1588321?v=3","gravatar_id":"","url":"https://api.github.com/users/carpasse","html_url":"https://github.com/carpasse","followers_url":"https://api.github.com/users/carpasse/followers","following_url":"https://api.github.com/users/carpasse/following{/other_user}","gists_url":"https://api.github.com/users/carpasse/gists{/gist_id}","starred_url":"https://api.github.com/users/carpasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carpasse/subscriptions","organizations_url":"https://api.github.com/users/carpasse/orgs","repos_url":"https://api.github.com/users/carpasse/repos","events_url":"https://api.github.com/users/carpasse/events{/privacy}","received_events_url":"https://api.github.com/users/carpasse/received_events","type":"User","site_admin":false},"body":"Added getFileExtension to libs. And used it on Html5 and Flash canHandleSource method to guess the mime type if necessary.","created_at":"2015-03-24T19:01:01Z","updated_at":"2015-03-24T23:15:29Z","closed_at":null,"merged_at":null,"merge_commit_sha":"b66fd9d798f930906b6c72e8d28cad510585b0e1","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/videojs/video.js/pulls/1974/commits","review_comments_url":"https://api.github.com/repos/videojs/video.js/pulls/1974/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/1974/comments","statuses_url":"https://api.github.com/repos/videojs/video.js/statuses/213c23d097963b072a9e52271f21b930b6729d21","head":{"label":"carpasse:feature/canhandlesource","ref":"feature/canhandlesource","sha":"213c23d097963b072a9e52271f21b930b6729d21","user":{"login":"carpasse","id":1588321,"avatar_url":"https://avatars.githubusercontent.com/u/1588321?v=3","gravatar_id":"","url":"https://api.github.com/users/carpasse","html_url":"https://github.com/carpasse","followers_url":"https://api.github.com/users/carpasse/followers","following_url":"https://api.github.com/users/carpasse/following{/other_user}","gists_url":"https://api.github.com/users/carpasse/gists{/gist_id}","starred_url":"https://api.github.com/users/carpasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carpasse/subscriptions","organizations_url":"https://api.github.com/users/carpasse/orgs","repos_url":"https://api.github.com/users/carpasse/repos","events_url":"https://api.github.com/users/carpasse/events{/privacy}","received_events_url":"https://api.github.com/users/carpasse/received_events","type":"User","site_admin":false},"repo":{"id":29536167,"name":"video.js","full_name":"carpasse/video.js","owner":{"login":"carpasse","id":1588321,"avatar_url":"https://avatars.githubusercontent.com/u/1588321?v=3","gravatar_id":"","url":"https://api.github.com/users/carpasse","html_url":"https://github.com/carpasse","followers_url":"https://api.github.com/users/carpasse/followers","following_url":"https://api.github.com/users/carpasse/following{/other_user}","gists_url":"https://api.github.com/users/carpasse/gists{/gist_id}","starred_url":"https://api.github.com/users/carpasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carpasse/subscriptions","organizations_url":"https://api.github.com/users/carpasse/orgs","repos_url":"https://api.github.com/users/carpasse/repos","events_url":"https://api.github.com/users/carpasse/events{/privacy}","received_events_url":"https://api.github.com/users/carpasse/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/carpasse/video.js","description":"Video.js - open source HTML5 & Flash video player","fork":true,"url":"https://api.github.com/repos/carpasse/video.js","forks_url":"https://api.github.com/repos/carpasse/video.js/forks","keys_url":"https://api.github.com/repos/carpasse/video.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/carpasse/video.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/carpasse/video.js/teams","hooks_url":"https://api.github.com/repos/carpasse/video.js/hooks","issue_events_url":"https://api.github.com/repos/carpasse/video.js/issues/events{/number}","events_url":"https://api.github.com/repos/carpasse/video.js/events","assignees_url":"https://api.github.com/repos/carpasse/video.js/assignees{/user}","branches_url":"https://api.github.com/repos/carpasse/video.js/branches{/branch}","tags_url":"https://api.github.com/repos/carpasse/video.js/tags","blobs_url":"https://api.github.com/repos/carpasse/video.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/carpasse/video.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/carpasse/video.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/carpasse/video.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/carpasse/video.js/statuses/{sha}","languages_url":"https://api.github.com/repos/carpasse/video.js/languages","stargazers_url":"https://api.github.com/repos/carpasse/video.js/stargazers","contributors_url":"https://api.github.com/repos/carpasse/video.js/contributors","subscribers_url":"https://api.github.com/repos/carpasse/video.js/subscribers","subscription_url":"https://api.github.com/repos/carpasse/video.js/subscription","commits_url":"https://api.github.com/repos/carpasse/video.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/carpasse/video.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/carpasse/video.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/carpasse/video.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/carpasse/video.js/contents/{+path}","compare_url":"https://api.github.com/repos/carpasse/video.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/carpasse/video.js/merges","archive_url":"https://api.github.com/repos/carpasse/video.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/carpasse/video.js/downloads","issues_url":"https://api.github.com/repos/carpasse/video.js/issues{/number}","pulls_url":"https://api.github.com/repos/carpasse/video.js/pulls{/number}","milestones_url":"https://api.github.com/repos/carpasse/video.js/milestones{/number}","notifications_url":"https://api.github.com/repos/carpasse/video.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/carpasse/video.js/labels{/name}","releases_url":"https://api.github.com/repos/carpasse/video.js/releases{/id}","created_at":"2015-01-20T15:20:26Z","updated_at":"2015-03-24T18:36:22Z","pushed_at":"2015-03-24T18:52:11Z","git_url":"git://github.com/carpasse/video.js.git","ssh_url":"git@github.com:carpasse/video.js.git","clone_url":"https://github.com/carpasse/video.js.git","svn_url":"https://github.com/carpasse/video.js","homepage":"www.videojs.com","size":11524,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"videojs:master","ref":"master","sha":"12df63d7e71a17e424ba3cb7213df8f9dd83f63a","user":{"login":"videojs","id":3287189,"avatar_url":"https://avatars.githubusercontent.com/u/3287189?v=3","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,"name":"video.js","full_name":"videojs/video.js","owner":{"login":"videojs","id":3287189,"avatar_url":"https://avatars.githubusercontent.com/u/3287189?v=3","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}","created_at":"2010-05-14T18:45:10Z","updated_at":"2015-03-24T22:04:44Z","pushed_at":"2015-03-24T19:01:01Z","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":20702,"stargazers_count":8400,"watchers_count":8400,"language":"JavaScript","has_issues":true,"has_downloads":false,"has_wiki":true,"has_pages":true,"forks_count":2292,"mirror_url":null,"open_issues_count":170,"forks":2292,"open_issues":170,"watchers":8400,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/videojs/video.js/pulls/1974"},"html":{"href":"https://github.com/videojs/video.js/pull/1974"},"issue":{"href":"https://api.github.com/repos/videojs/video.js/issues/1974"},"comments":{"href":"https://api.github.com/repos/videojs/video.js/issues/1974/comments"},"review_comments":{"href":"https://api.github.com/repos/videojs/video.js/pulls/1974/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/1974/commits"},"statuses":{"href":"https://api.github.com/repos/videojs/video.js/statuses/213c23d097963b072a9e52271f21b930b6729d21"}}}}