का पहलू अनुपात मैं वीडियोव्यू भरने के उद्देश्य से वीडियो खींचने का प्रयास करता हूं। लक्ष्य यह देखने के लिए है कि डिवाइस में पहली तस्वीर की तरह दिखता है (जैसे यह लेआउट पूर्वावलोकन में दिखता है)।वीडियो व्यू भरने के लिए खिंचाव, वीडियो व्यू
इस सवालों के जवाब में से अधिकांश this link को देखें।
मैं इस कोशिश की, लेकिन मैं अभी भी वीडियो दृश्य नहीं भरा था।
यह मेरा लेआउट कोड:
हालांकि, डिवाइस पर परिणाम अलग है::
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
android:background="@drawable/search_gren_screen">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal" >
<Button
android:id="@+id/go_back"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="onclick"
android:text="Try again" />
<Button
android:id="@+id/back_to_pick_song"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:text="Select another song"
android:onClick="onclick" />
<Button
android:id="@+id/btn_continue"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center"
android:layout_weight="1"
android:onClick="onclick"
android:text="Amazing, continue!" />
</LinearLayout>
<FrameLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent">
<VideoView
android:id="@+id/videoView1"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:layout_alignParentBottom="true"
android:layout_alignParentLeft="true"
android:layout_alignParentRight="true"
android:layout_alignParentTop="true"
android:layout_gravity="center" />
</FrameLayout>
</LinearLayout>
यहाँ आप मेरी घोषित लेआउट के एक पूर्वावलोकन है
आपका लेआउट कोड अपनी जरूरत को पूरा करने के ठीक है आवश्यकता नहीं है। लेकिन ध्यान रखें कि 'वीडियो व्यू' उसमें चल रहे वीडियो के संबंध में घट जाएगा/खिंचाव करेगा। –
ठीक है, इसलिए मुझे मीडिया रिकॉर्डर के पहलू अनुपात को बदलने की जरूरत है mmediaRecorder.setVideoSize (640, 480) जोड़ने के लिए; मैं कोशिश करता हूं और यह काम करता है ... ??? – idan
जांच इस जवाब http://stackoverflow.com/a/38971707/1153703 –