| Issue 487935 | Android doesn't support screen capturing | ||||||||||||||
| Starred by 14 users | Reported by jiajia....@intel.com, May 14 2015 | Back to list | |||||||||||||
UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2272.89 Safari/537.36 Example URL: Steps to reproduce the problem: 1. Put the attachment file screen_capture_simple.html to a http server 2. $ adb push chrome-command-line /data/local/tmp # The content of chrome-command-line is below: chrome --enable-usermedia-screen-capturing --allow-http-screen-capture 3. Use chrome to open step 1's address 4. Click 'Start to Capture Screen' button in that page. What is the expected behavior? The current screen should be shown in the video tag filed. What went wrong? Nothing is shown. Did this work before? No Is it a problem with Flash or HTML5? HTML5 Does this work in other browsers? N/A Chrome version: 41.0.2272.89 Channel: n/a OS Version: Flash Version: Shockwave Flash 17.0 r0
Comment 1
by
kavvaru@chromium.org,
May 15 2015
,
May 20 2015
,
May 20 2015
,
May 20 2015
This is expected; we haven't implemented the feature for Android yet - moving Unconfirmed->Untriaged. :)
,
May 21 2015
I am trying to implement this feature. See https://codereview.chromium.org/1140113002/. Welcome to give comments and suggestions.
,
May 22 2015
OK, cool. :) Note that screen-capture via getUserMedia() is not yet standardized, and the desktop Chrome support is currently behind a whitelist, so it's not a feature available to general web content as yet.
,
May 22 2015
Desktop Chrome support is ACLed to extensions, not to a whitelist.
,
May 26 2015
,
Jun 4 2015
Hi, all. I write a short design doc https://docs.google.com/document/d/13-OKb_MyTwYlCULEeRxtDD_N8TqBhHaOWC6ZIYOrC7s/edit?usp=sharing to describe my implementation. There lists the security issue and some design concerns. I am eager to get more valuable opinions and push this work continue. Currently, I am considering to adopt @sergey's advice to hide the feature behind a compile-time flag, disabled by default. I want to know if this method is acceptable and is there any other problem we need to resolve? Thanks.
,
Jun 5 2015
,
Apr 27 2016
I'll take it from here.
,
Jul 1 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/2f731e17983201082d9fc725cf7717868fc1e75d commit 2f731e17983201082d9fc725cf7717868fc1e75d Author: braveyao <braveyao@chromium.org> Date: Fri Jul 01 22:36:08 2016 ScreenCapture for Android phase1, part I The document about ScreenCapture for Android is here, https://goo.gl/QNH29g. This cl is mainly based on the https://codereview.chromium.org/1140113002/. Only the codes under media/ are included here, which implements the JAVA capture with Android MediaProjection API and JNI connectors, with some issues fixed so it can always work. The control part in content/ and chrome/ will be in the next cl, as part II. BUG=487935 Review-Url: https://codereview.chromium.org/1917023003 Cr-Commit-Position: refs/heads/master@{#403555} [modify] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/chrome/android/BUILD.gn [modify] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/content/app/android/library_loader_hooks.cc [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/content/browser/media/capture/screen_capture_device_android.cc [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/content/browser/media/capture/screen_capture_device_android.h [modify] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/content/content_browser.gypi [modify] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/content/public/android/BUILD.gn [modify] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/media/capture/BUILD.gn [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/media/capture/content/android/BUILD.gn [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/media/capture/content/android/screen_capture_jni_registrar.cc [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/media/capture/content/android/screen_capture_jni_registrar.h [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/media/capture/content/android/screen_capture_machine_android.cc [add] https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d/media/capture/content/android/screen_capture_machine_android.h
,
Jul 1 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f9fdeda904daa23f306c6adc9f629756db3beeed commit f9fdeda904daa23f306c6adc9f629756db3beeed Author: kelvinp <kelvinp@chromium.org> Date: Fri Jul 01 22:59:17 2016 Revert of ScreenCapture for Android phase1, part I (patchset #12 id:340001 of https://codereview.chromium.org/1917023003/ ) Reason for revert: Break compile step on Android Builder logs: https://build.chromium.org/p/chromium/builders/Android/builds/58512/steps/compile/logs/stdio Failure: In file included from ../../media/capture/content/thread_safe_capture_oracle.h:15:0, from ../../media/capture/content/screen_capture_device_core.h:15, from ../../media/capture/content/android/screen_capture_machine_android.h:12, from ../../media/capture/content/android/screen_capture_jni_registrar.cc:10: ../../media/capture/video/video_capture_device.h:33:55: fatal error: media/mojo/interfaces/image_capture.mojom.h: No such file or directory #include "media/mojo/interfaces/image_capture.mojom.h" Original issue's description: > ScreenCapture for Android phase1, part I > > The document about ScreenCapture for Android is here, https://goo.gl/QNH29g. > This cl is mainly based on the https://codereview.chromium.org/1140113002/. > Only the codes under media/ are included here, which implements the JAVA > capture with Android MediaProjection API and JNI connectors, with some issues > fixed so it can always work. > The control part in content/ and chrome/ will be in the next cl, as part II. > > BUG=487935 > > Committed: https://crrev.com/2f731e17983201082d9fc725cf7717868fc1e75d > Cr-Commit-Position: refs/heads/master@{#403555} TBR=dalecurtis@chromium.org,mcasas@chromium.org,michaelbai@chromium.org,miu@chromium.org,qinmin@chromium.org,sergeyu@chromium.org,tedchoc@chromium.org,braveyao@chromium.org # Skipping CQ checks because original CL landed less than 1 days ago. NOPRESUBMIT=true NOTREECHECKS=true NOTRY=true BUG=487935 Review-Url: https://codereview.chromium.org/2116883002 Cr-Commit-Position: refs/heads/master@{#403557} [modify] https://crrev.com/f9fdeda904daa23f306c6adc9f629756db3beeed/chrome/android/BUILD.gn [modify] https://crrev.com/f9fdeda904daa23f306c6adc9f629756db3beeed/content/app/android/library_loader_hooks.cc [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/content/browser/media/capture/screen_capture_device_android.cc [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/content/browser/media/capture/screen_capture_device_android.h [modify] https://crrev.com/f9fdeda904daa23f306c6adc9f629756db3beeed/content/content_browser.gypi [modify] https://crrev.com/f9fdeda904daa23f306c6adc9f629756db3beeed/content/public/android/BUILD.gn [modify] https://crrev.com/f9fdeda904daa23f306c6adc9f629756db3beeed/media/capture/BUILD.gn [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/media/capture/content/android/BUILD.gn [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/media/capture/content/android/screen_capture_jni_registrar.cc [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/media/capture/content/android/screen_capture_jni_registrar.h [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/media/capture/content/android/screen_capture_machine_android.cc [delete] https://crrev.com/b763ce88f69183ca5ffde59cc41ca047e5db6b7f/media/capture/content/android/screen_capture_machine_android.h
,
Jul 7 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/7508a100080e04e8c430777aab7cb91cbcdd1ced commit 7508a100080e04e8c430777aab7cb91cbcdd1ced Author: braveyao <braveyao@chromium.org> Date: Thu Jul 07 00:06:17 2016 Reland: ScreenCapture for Android phase1, part I (patchset #12 id:340001 https://codereview.chromium.org/1917023003/) Which got reverted due to breakage of compiling on Android bots intermittently. (see https://codereview.chromium.org/2116883002) Recenctly, media/capture/video/video_capture_device.h starts to include media/mojo/interfaces/image_capture.mojom.h, which also requests the dependency to //media/mojo/interfaces:image_capture. So does same thing to media/capture/content/android/BUILD.gn. No other changed involved. Original description -------------------------------------- ScreenCapture for Android phase1, part I The document about ScreenCapture for Android is here, https://goo.gl/QNH29g. This cl is mainly based on the https://codereview.chromium.org/1140113002/. Only the codes under media/ are included here, which implements the JAVA capture with Android MediaProjection API and JNI connectors, with some issues fixed so it can always work. The control part in content/ and chrome/ will be in the next cl, as part II. BUG=487935 ----------------------------------------------------------------------- BUG = 487935 TBR=dalecurtis@chromium.org,mcasas@chromium.org,michaelbai@chromium.org,miu@chromium.org,qinmin@chromium.org,tedchoc@chromium.org Review-Url: https://codereview.chromium.org/2125973002 Cr-Commit-Position: refs/heads/master@{#403996} [modify] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/chrome/android/BUILD.gn [modify] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/content/app/android/library_loader_hooks.cc [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/content/browser/media/capture/screen_capture_device_android.cc [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/content/browser/media/capture/screen_capture_device_android.h [modify] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/content/content_browser.gypi [modify] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/content/public/android/BUILD.gn [modify] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/media/capture/BUILD.gn [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/media/capture/content/android/BUILD.gn [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/media/capture/content/android/screen_capture_jni_registrar.cc [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/media/capture/content/android/screen_capture_jni_registrar.h [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/media/capture/content/android/screen_capture_machine_android.cc [add] https://crrev.com/7508a100080e04e8c430777aab7cb91cbcdd1ced/media/capture/content/android/screen_capture_machine_android.h
,
Aug 9 2016
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/92b46bda640a3bd8f1639778309458e852d84df6 commit 92b46bda640a3bd8f1639778309458e852d84df6 Author: braveyao <braveyao@chromium.org> Date: Tue Aug 09 18:07:25 2016 Android: add screen share icon for permission infobar This is to add new screen share icon for the upcoming screen capture feature in chrome on Android(in cl https://codereview.chromium.org/2123863004/). The permission infobar with this screen share icon will be promoted each time when screen sharing is requested. BUG=487935 Review-Url: https://codereview.chromium.org/2226123002 Cr-Commit-Position: refs/heads/master@{#410741} [add] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/android/java/res/drawable-hdpi/infobar_screen_share.png [add] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/android/java/res/drawable-mdpi/infobar_screen_share.png [add] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/android/java/res/drawable-xhdpi/infobar_screen_share.png [add] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/android/java/res/drawable-xxhdpi/infobar_screen_share.png [add] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/android/java/res/drawable-xxxhdpi/infobar_screen_share.png [add] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/app/theme/default_100_percent/common/infobar_media_stream_screen_share.png [add] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/app/theme/default_200_percent/common/infobar_media_stream_screen_share.png [modify] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/app/theme/theme_resources.grd [modify] https://crrev.com/92b46bda640a3bd8f1639778309458e852d84df6/chrome/browser/android/resource_id.h
,
Sep 23
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94 commit dbb85e451ee0ffe9d18300befb9c0d0664b5ee94 Author: braveyao <braveyao@chromium.org> Date: Fri Sep 23 18:49:08 2016 ScreenCapture for Android phase1, part II The capture part has been landed in cl https://codereview.chromium.org/2125973002/. This cl is to implement the control part in chrome/ and content/. The document is here, https://goo.gl/QNH29g. This cl proposes a pemission design on Android, including permission info bar and head up notification, which will show up each time at starting screen capture and user can check/stop the capture without leaving current page. And all of these is behind a flag as an experimental feature. BUG=487935 Review-Url: https://codereview.chromium.org/2123863004 Cr-Commit-Position: refs/heads/master@{#420679} [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/android/java/src/org/chromium/chrome/browser/media/MediaCaptureNotificationService.java [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsDelegateAndroid.java [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/android/java/src/org/chromium/chrome/browser/tab/TabWebContentsObserver.java [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/android/java/src/org/chromium/chrome/browser/tabmodel/TabWindowManager.java [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/android/java/strings/android_chrome_strings.grd [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/android/javatests/src/org/chromium/chrome/browser/tabmodel/TabWindowManagerTest.java [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/app/generated_resources.grd [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/BUILD.gn [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/about_flags.cc [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/android/chrome_feature_list.cc [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/android/chrome_feature_list.h [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/android/tab_web_contents_delegate_android.cc [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/media/webrtc/media_stream_capture_indicator.cc [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/media/webrtc/media_stream_capture_indicator.h [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/media/webrtc/media_stream_devices_controller_browsertest.cc [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/media/webrtc/permission_bubble_media_access_handler.cc [add] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.cc [add] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/chrome/browser/media/webrtc/screen_capture_infobar_delegate_android.h [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/components/infobars/core/infobar_delegate.h [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/content/browser/BUILD.gn [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/content/browser/renderer_host/media/video_capture_manager.cc [modify] https://crrev.com/dbb85e451ee0ffe9d18300befb9c0d0664b5ee94/tools/metrics/histograms/histograms.xml
,
Sep 23
Now screen capture is available with some basic functionalities on Android behind a flag.
How to test it:
- in chrome://flags page, enable the flag "Experimental ScreenCapture android"
- getUserMedia with constraints "video: {'mandatory': {'chromeMediaSource':'screen'}}". And you can specify frame size and frame rate as well. (Audio must be set to false.)
- click Allow on the permission infobar.
- When you firstly request screen capture, there is also a system permission dialog (which is supposed to be shown each time at requesting screen capture). At present, it's best to check the option "Don't show again" and click "START NOW". Then it won't emerge next time.
- screen capture should start to work. There is a notification to suggest on going screen capture and you can also stop capture there without leaving the page.
What's coming soon:
- Device rotation support. Currently rotating the device will cause the black padding.
- Show notification after screen capture starts. Currently they are shown at same time. The head-up notification may cause some delayed response of clicking the "START NOW' button in the system permission dialog.
Known issues(we are asking support from Android side, so they may be solved in the future):
- Dual permission. At present there will be both permission infobar from Chrome and permission dialog from system(if you didn't choose "Dont show again") to start screen capture.
- We prefer I420 output of MediaProjection. But it's only available on some devices and we'll fallback to RGBA_8888 if the device reports failure to I420 request. But some device may fail silently and no screen capture available.
,
Sep 24
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a2f67c812a83157e7eb24b81fd3aa51e978fbfb8 commit a2f67c812a83157e7eb24b81fd3aa51e978fbfb8 Author: mostynb <mostynb@opera.com> Date: Sat Sep 24 06:53:50 2016 unbreak builds with webrtc disabled https://codereview.chromium.org/2123863004 broke non-webrtc non-android builds. Let's fix that. BUG=487935 Review-Url: https://codereview.chromium.org/2370583002 Cr-Commit-Position: refs/heads/master@{#420832} [modify] https://crrev.com/a2f67c812a83157e7eb24b81fd3aa51e978fbfb8/content/browser/renderer_host/media/video_capture_manager.cc
,
Oct 19
,
Nov 5
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/709ed4c443cb400660e0d88c888a0e9a4fbd5536 commit 709ed4c443cb400660e0d88c888a0e9a4fbd5536 Author: braveyao <braveyao@chromium.org> Date: Sat Nov 05 01:12:06 2016 Android ScreenCapture: add support to device rotation. When device is rotated during screen capturing with MediaProjection API on Android, the rotated screen will be captured and fit into the frame requested with padding. So when we detect a device rotation, we need to re-create capture with the new orientation and update the oracle. Also refactored(mainly reordered some lines) the java file a bit for a newly added unittest file. BUG=487935 Review-Url: https://codereview.chromium.org/2468383002 Cr-Commit-Position: refs/heads/master@{#430111} [modify] https://crrev.com/709ed4c443cb400660e0d88c888a0e9a4fbd5536/content/browser/media/capture/screen_capture_device_android.h [add] https://crrev.com/709ed4c443cb400660e0d88c888a0e9a4fbd5536/content/browser/media/capture/screen_capture_device_android_unittest.cc [modify] https://crrev.com/709ed4c443cb400660e0d88c888a0e9a4fbd5536/content/test/BUILD.gn [modify] https://crrev.com/709ed4c443cb400660e0d88c888a0e9a4fbd5536/media/capture/content/android/java/src/org/chromium/media/ScreenCapture.java [modify] https://crrev.com/709ed4c443cb400660e0d88c888a0e9a4fbd5536/media/capture/content/android/screen_capture_machine_android.cc [modify] https://crrev.com/709ed4c443cb400660e0d88c888a0e9a4fbd5536/media/capture/content/android/screen_capture_machine_android.h
,
Nov 15
Bumping to M57. Please update if that's wrong.
,
Dec 16
,
Jan 3
Hi, I did a test with revision M-55. Works! But when I leaved Chrome (change to another application), the streaming stoped (freeze)! Is it normal? Tks a lot.
,
Jan 3
That depends. When you switch back to Chrome, will the capture continue? Or chrome will be re-launched totally? There are some Apps are too huge and Android will terminate the background apps. Please double check if this is your case.
,
Jan 4
Yes, when I back to Chrome the capture continue. I Made an example: https://drive.google.com/file/d/0B3DQ5vCWbTeDdjhnR2MwSzZoQ0U/view Android 6.0.1;SM-A510M Build/MMB29K - Chrome 55.0.2883.91
,
Jan 9
Thanks for the report! It's a regression, in which I gave a wrong review comments. Trying to land a fix soon.
,
Jan 23
Bumping this to M58. Please correct if that's wrong.
,
Feb 22
,
Mar 22
(5 days ago)
|
|||||||||||||||
| ► Sign in to add a comment | |||||||||||||||