Stay organized with collections
Save and categorize content based on your preferences.
VideoSource
class VideoSource
Defines the video source. These constants are used with MediaRecorder.setVideoSource(int)
.
Summary
Constants |
static Int |
Camera video source
|
static Int |
|
static Int |
Surface video source
|
Constants
DEFAULT
static val DEFAULT: Int
Value: 0
SURFACE
static val SURFACE: Int
Surface video source
Using a Surface as video source.
This flag must be used when recording from an android.hardware.camera2
API source.
When using this video source type, use MediaRecorder.getSurface()
to retrieve the surface created by MediaRecorder.
Value: 2
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# MediaRecorder.VideoSource\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nVideoSource\n===========\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/media/MediaRecorder.VideoSource \"View this page in Java\") \n\n```\nclass VideoSource\n```\n\n|---|----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.media.MediaRecorder.VideoSource](#) |\n\nDefines the video source. These constants are used with [MediaRecorder.setVideoSource(int)](/reference/kotlin/android/media/MediaRecorder#setVideoSource(kotlin.Int)).\n\nSummary\n-------\n\n| Constants ||\n|-----------------------------------------------------------------------------------|-----------------------------------------------------|\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [CAMERA](#CAMERA:kotlin.Int) Camera video source |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [DEFAULT](#DEFAULT:kotlin.Int) \u003cbr /\u003e |\n| static [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [SURFACE](#SURFACE:kotlin.Int) Surface video source |\n\nConstants\n---------\n\n### CAMERA\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val CAMERA: Int\n```\n\nCamera video source\n\nUsing the [android.hardware.Camera](../hardware/Camera.html#) API as video source. \n\n Value: 1\n\n### DEFAULT\n\nAdded in [API level 3](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val DEFAULT: Int\n``` \n\n Value: 0\n\n### SURFACE\n\nAdded in [API level 21](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nstatic val SURFACE: Int\n```\n\nSurface video source\n\nUsing a Surface as video source.\n\nThis flag must be used when recording from an [android.hardware.camera2](../hardware/camera2/package-summary.html) API source.\n\nWhen using this video source type, use [MediaRecorder.getSurface()](/reference/kotlin/android/media/MediaRecorder#getSurface()) to retrieve the surface created by MediaRecorder. \n\n Value: 2"]]