{"action":"created","comment":{"url":"https://api.github.com/repos/cobala9211/VideoApp/pulls/comments/75048895","id":75048895,"diff_hunk":"@@ -89,6 +116,101 @@ public boolean onCreateOptionsMenu(Menu menu) {\n         return true;\n     }\n \n+    private void showFileChooser() {\n+        Intent intent = new Intent(Intent.ACTION_GET_CONTENT);\n+        intent.setType(getString(R.string.main_constant_video_type_all_file_mp4));\n+        intent.addCategory(Intent.CATEGORY_OPENABLE);\n+        try {\n+            startActivityForResult(\n+                    Intent.createChooser(intent, getString(R.string.main_constant_file_choices_text)),\n+                    FILE_SELECT_CODE);\n+        } catch (android.content.ActivityNotFoundException ex) {\n+            Toast.makeText(this, getResources().getString(R.string.main_toast_text_error_content),\n+                    Toast.LENGTH_SHORT).show();\n+        }\n+    }\n+\n+    private void initProgress() {\n+        mProgressDialog = new ProgressDialog(MainActivity.this);\n+        mProgressDialog.setTitle(getString(R.string.main_progressdialog_text_title_progressdialog));\n+        mProgressDialog.setMessage(getString(R.string.main_progressdialog_text_message_progressdialog));\n+        mProgressDialog.show();\n+    }\n+\n+    @Override\n+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n+        super.onActivityResult(requestCode, resultCode, data);\n+        if (requestCode == FILE_SELECT_CODE && resultCode == Activity.RESULT_OK) {\n+            final String path = geRealPathFromUri(MainActivity.this, data.getData());\n+            MediaPlayer mediaPlayer = MediaPlayer.create(this, Uri.parse(path));\n+            File file = new File(path);\n+            final String name = file.getName();\n+            final String duration = String.valueOf(mediaPlayer.getDuration());\n+            final String date = getDateSystem();\n+            StorageReference storageReference = FirebaseStorage.getInstance().getReferenceFromUrl(getString(R.string.main_firebase_linkbase_database_video_online));\n+            StorageReference fileVideo = storageReference.child(getString(R.string.main_constant_video_type_video) + name);\n+            UploadTask uploadTask = fileVideo.putFile(data.getData());\n+            initProgress();\n+            uploadTask.addOnProgressListener(new OnProgressListener<UploadTask.TaskSnapshot>() {\n+                @Override\n+                public void onProgress(UploadTask.TaskSnapshot taskSnapshot) {\n+                    double progress = (100.0 * taskSnapshot.getBytesTransferred()) / taskSnapshot.getTotalByteCount();","path":"app/src/main/java/com/example/dnp/videoapp/activity/MainActivity.java","position":119,"original_position":119,"commit_id":"65a2f0c8c21de6c164a84ab1f33726a9924456cd","original_commit_id":"65a2f0c8c21de6c164a84ab1f33726a9924456cd","user":{"login":"at-binc","id":16132112,"avatar_url":"https://avatars.githubusercontent.com/u/16132112?v=3","gravatar_id":"","url":"https://api.github.com/users/at-binc","html_url":"https://github.com/at-binc","followers_url":"https://api.github.com/users/at-binc/followers","following_url":"https://api.github.com/users/at-binc/following{/other_user}","gists_url":"https://api.github.com/users/at-binc/gists{/gist_id}","starred_url":"https://api.github.com/users/at-binc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/at-binc/subscriptions","organizations_url":"https://api.github.com/users/at-binc/orgs","repos_url":"https://api.github.com/users/at-binc/repos","events_url":"https://api.github.com/users/at-binc/events{/privacy}","received_events_url":"https://api.github.com/users/at-binc/received_events","type":"User","site_admin":false},"body":"vì răng đây có 100.0","created_at":"2016-08-17T01:09:07Z","updated_at":"2016-08-17T01:09:07Z","html_url":"https://github.com/cobala9211/VideoApp/pull/2#discussion_r75048895","pull_request_url":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2","_links":{"self":{"href":"https://api.github.com/repos/cobala9211/VideoApp/pulls/comments/75048895"},"html":{"href":"https://github.com/cobala9211/VideoApp/pull/2#discussion_r75048895"},"pull_request":{"href":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2"}}},"pull_request":{"url":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2","id":81477300,"html_url":"https://github.com/cobala9211/VideoApp/pull/2","diff_url":"https://github.com/cobala9211/VideoApp/pull/2.diff","patch_url":"https://github.com/cobala9211/VideoApp/pull/2.patch","issue_url":"https://api.github.com/repos/cobala9211/VideoApp/issues/2","number":2,"state":"open","locked":false,"title":"create funtion upload file, config gradle firebase, create object Vid…","user":{"login":"cobala9211","id":20347260,"avatar_url":"https://avatars.githubusercontent.com/u/20347260?v=3","gravatar_id":"","url":"https://api.github.com/users/cobala9211","html_url":"https://github.com/cobala9211","followers_url":"https://api.github.com/users/cobala9211/followers","following_url":"https://api.github.com/users/cobala9211/following{/other_user}","gists_url":"https://api.github.com/users/cobala9211/gists{/gist_id}","starred_url":"https://api.github.com/users/cobala9211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cobala9211/subscriptions","organizations_url":"https://api.github.com/users/cobala9211/orgs","repos_url":"https://api.github.com/users/cobala9211/repos","events_url":"https://api.github.com/users/cobala9211/events{/privacy}","received_events_url":"https://api.github.com/users/cobala9211/received_events","type":"User","site_admin":false},"body":"…eoOnline","created_at":"2016-08-16T14:04:53Z","updated_at":"2016-08-17T01:09:07Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e594ed9df5b43fb3517034b91d98204ad21f849b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2/commits","review_comments_url":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2/comments","review_comment_url":"https://api.github.com/repos/cobala9211/VideoApp/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cobala9211/VideoApp/issues/2/comments","statuses_url":"https://api.github.com/repos/cobala9211/VideoApp/statuses/65a2f0c8c21de6c164a84ab1f33726a9924456cd","head":{"label":"cobala9211:upload_video/20160816-phuongdn-upload_video_create_data","ref":"upload_video/20160816-phuongdn-upload_video_create_data","sha":"65a2f0c8c21de6c164a84ab1f33726a9924456cd","user":{"login":"cobala9211","id":20347260,"avatar_url":"https://avatars.githubusercontent.com/u/20347260?v=3","gravatar_id":"","url":"https://api.github.com/users/cobala9211","html_url":"https://github.com/cobala9211","followers_url":"https://api.github.com/users/cobala9211/followers","following_url":"https://api.github.com/users/cobala9211/following{/other_user}","gists_url":"https://api.github.com/users/cobala9211/gists{/gist_id}","starred_url":"https://api.github.com/users/cobala9211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cobala9211/subscriptions","organizations_url":"https://api.github.com/users/cobala9211/orgs","repos_url":"https://api.github.com/users/cobala9211/repos","events_url":"https://api.github.com/users/cobala9211/events{/privacy}","received_events_url":"https://api.github.com/users/cobala9211/received_events","type":"User","site_admin":false},"repo":{"id":65350679,"name":"VideoApp","full_name":"cobala9211/VideoApp","owner":{"login":"cobala9211","id":20347260,"avatar_url":"https://avatars.githubusercontent.com/u/20347260?v=3","gravatar_id":"","url":"https://api.github.com/users/cobala9211","html_url":"https://github.com/cobala9211","followers_url":"https://api.github.com/users/cobala9211/followers","following_url":"https://api.github.com/users/cobala9211/following{/other_user}","gists_url":"https://api.github.com/users/cobala9211/gists{/gist_id}","starred_url":"https://api.github.com/users/cobala9211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cobala9211/subscriptions","organizations_url":"https://api.github.com/users/cobala9211/orgs","repos_url":"https://api.github.com/users/cobala9211/repos","events_url":"https://api.github.com/users/cobala9211/events{/privacy}","received_events_url":"https://api.github.com/users/cobala9211/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cobala9211/VideoApp","description":null,"fork":false,"url":"https://api.github.com/repos/cobala9211/VideoApp","forks_url":"https://api.github.com/repos/cobala9211/VideoApp/forks","keys_url":"https://api.github.com/repos/cobala9211/VideoApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cobala9211/VideoApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cobala9211/VideoApp/teams","hooks_url":"https://api.github.com/repos/cobala9211/VideoApp/hooks","issue_events_url":"https://api.github.com/repos/cobala9211/VideoApp/issues/events{/number}","events_url":"https://api.github.com/repos/cobala9211/VideoApp/events","assignees_url":"https://api.github.com/repos/cobala9211/VideoApp/assignees{/user}","branches_url":"https://api.github.com/repos/cobala9211/VideoApp/branches{/branch}","tags_url":"https://api.github.com/repos/cobala9211/VideoApp/tags","blobs_url":"https://api.github.com/repos/cobala9211/VideoApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cobala9211/VideoApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cobala9211/VideoApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cobala9211/VideoApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cobala9211/VideoApp/statuses/{sha}","languages_url":"https://api.github.com/repos/cobala9211/VideoApp/languages","stargazers_url":"https://api.github.com/repos/cobala9211/VideoApp/stargazers","contributors_url":"https://api.github.com/repos/cobala9211/VideoApp/contributors","subscribers_url":"https://api.github.com/repos/cobala9211/VideoApp/subscribers","subscription_url":"https://api.github.com/repos/cobala9211/VideoApp/subscription","commits_url":"https://api.github.com/repos/cobala9211/VideoApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cobala9211/VideoApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cobala9211/VideoApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cobala9211/VideoApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cobala9211/VideoApp/contents/{+path}","compare_url":"https://api.github.com/repos/cobala9211/VideoApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cobala9211/VideoApp/merges","archive_url":"https://api.github.com/repos/cobala9211/VideoApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cobala9211/VideoApp/downloads","issues_url":"https://api.github.com/repos/cobala9211/VideoApp/issues{/number}","pulls_url":"https://api.github.com/repos/cobala9211/VideoApp/pulls{/number}","milestones_url":"https://api.github.com/repos/cobala9211/VideoApp/milestones{/number}","notifications_url":"https://api.github.com/repos/cobala9211/VideoApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cobala9211/VideoApp/labels{/name}","releases_url":"https://api.github.com/repos/cobala9211/VideoApp/releases{/id}","deployments_url":"https://api.github.com/repos/cobala9211/VideoApp/deployments","created_at":"2016-08-10T04:31:17Z","updated_at":"2016-08-10T04:35:46Z","pushed_at":"2016-08-16T14:04:53Z","git_url":"git://github.com/cobala9211/VideoApp.git","ssh_url":"git@github.com:cobala9211/VideoApp.git","clone_url":"https://github.com/cobala9211/VideoApp.git","svn_url":"https://github.com/cobala9211/VideoApp","homepage":null,"size":275,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"cobala9211:master","ref":"master","sha":"ce873b238a7d6d523ccd4d2561849501a625e2cc","user":{"login":"cobala9211","id":20347260,"avatar_url":"https://avatars.githubusercontent.com/u/20347260?v=3","gravatar_id":"","url":"https://api.github.com/users/cobala9211","html_url":"https://github.com/cobala9211","followers_url":"https://api.github.com/users/cobala9211/followers","following_url":"https://api.github.com/users/cobala9211/following{/other_user}","gists_url":"https://api.github.com/users/cobala9211/gists{/gist_id}","starred_url":"https://api.github.com/users/cobala9211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cobala9211/subscriptions","organizations_url":"https://api.github.com/users/cobala9211/orgs","repos_url":"https://api.github.com/users/cobala9211/repos","events_url":"https://api.github.com/users/cobala9211/events{/privacy}","received_events_url":"https://api.github.com/users/cobala9211/received_events","type":"User","site_admin":false},"repo":{"id":65350679,"name":"VideoApp","full_name":"cobala9211/VideoApp","owner":{"login":"cobala9211","id":20347260,"avatar_url":"https://avatars.githubusercontent.com/u/20347260?v=3","gravatar_id":"","url":"https://api.github.com/users/cobala9211","html_url":"https://github.com/cobala9211","followers_url":"https://api.github.com/users/cobala9211/followers","following_url":"https://api.github.com/users/cobala9211/following{/other_user}","gists_url":"https://api.github.com/users/cobala9211/gists{/gist_id}","starred_url":"https://api.github.com/users/cobala9211/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cobala9211/subscriptions","organizations_url":"https://api.github.com/users/cobala9211/orgs","repos_url":"https://api.github.com/users/cobala9211/repos","events_url":"https://api.github.com/users/cobala9211/events{/privacy}","received_events_url":"https://api.github.com/users/cobala9211/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/cobala9211/VideoApp","description":null,"fork":false,"url":"https://api.github.com/repos/cobala9211/VideoApp","forks_url":"https://api.github.com/repos/cobala9211/VideoApp/forks","keys_url":"https://api.github.com/repos/cobala9211/VideoApp/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cobala9211/VideoApp/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cobala9211/VideoApp/teams","hooks_url":"https://api.github.com/repos/cobala9211/VideoApp/hooks","issue_events_url":"https://api.github.com/repos/cobala9211/VideoApp/issues/events{/number}","events_url":"https://api.github.com/repos/cobala9211/VideoApp/events","assignees_url":"https://api.github.com/repos/cobala9211/VideoApp/assignees{/user}","branches_url":"https://api.github.com/repos/cobala9211/VideoApp/branches{/branch}","tags_url":"https://api.github.com/repos/cobala9211/VideoApp/tags","blobs_url":"https://api.github.com/repos/cobala9211/VideoApp/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cobala9211/VideoApp/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cobala9211/VideoApp/git/refs{/sha}","trees_url":"https://api.github.com/repos/cobala9211/VideoApp/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cobala9211/VideoApp/statuses/{sha}","languages_url":"https://api.github.com/repos/cobala9211/VideoApp/languages","stargazers_url":"https://api.github.com/repos/cobala9211/VideoApp/stargazers","contributors_url":"https://api.github.com/repos/cobala9211/VideoApp/contributors","subscribers_url":"https://api.github.com/repos/cobala9211/VideoApp/subscribers","subscription_url":"https://api.github.com/repos/cobala9211/VideoApp/subscription","commits_url":"https://api.github.com/repos/cobala9211/VideoApp/commits{/sha}","git_commits_url":"https://api.github.com/repos/cobala9211/VideoApp/git/commits{/sha}","comments_url":"https://api.github.com/repos/cobala9211/VideoApp/comments{/number}","issue_comment_url":"https://api.github.com/repos/cobala9211/VideoApp/issues/comments{/number}","contents_url":"https://api.github.com/repos/cobala9211/VideoApp/contents/{+path}","compare_url":"https://api.github.com/repos/cobala9211/VideoApp/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cobala9211/VideoApp/merges","archive_url":"https://api.github.com/repos/cobala9211/VideoApp/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cobala9211/VideoApp/downloads","issues_url":"https://api.github.com/repos/cobala9211/VideoApp/issues{/number}","pulls_url":"https://api.github.com/repos/cobala9211/VideoApp/pulls{/number}","milestones_url":"https://api.github.com/repos/cobala9211/VideoApp/milestones{/number}","notifications_url":"https://api.github.com/repos/cobala9211/VideoApp/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cobala9211/VideoApp/labels{/name}","releases_url":"https://api.github.com/repos/cobala9211/VideoApp/releases{/id}","deployments_url":"https://api.github.com/repos/cobala9211/VideoApp/deployments","created_at":"2016-08-10T04:31:17Z","updated_at":"2016-08-10T04:35:46Z","pushed_at":"2016-08-16T14:04:53Z","git_url":"git://github.com/cobala9211/VideoApp.git","ssh_url":"git@github.com:cobala9211/VideoApp.git","clone_url":"https://github.com/cobala9211/VideoApp.git","svn_url":"https://github.com/cobala9211/VideoApp","homepage":null,"size":275,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2"},"html":{"href":"https://github.com/cobala9211/VideoApp/pull/2"},"issue":{"href":"https://api.github.com/repos/cobala9211/VideoApp/issues/2"},"comments":{"href":"https://api.github.com/repos/cobala9211/VideoApp/issues/2/comments"},"review_comments":{"href":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2/comments"},"review_comment":{"href":"https://api.github.com/repos/cobala9211/VideoApp/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cobala9211/VideoApp/pulls/2/commits"},"statuses":{"href":"https://api.github.com/repos/cobala9211/VideoApp/statuses/65a2f0c8c21de6c164a84ab1f33726a9924456cd"}}}}
{"actor":{"display_login":"at-binc"}}