मैं YouTubePlayer (Android के लिए YouTube एपीआई) का उपयोग कर रहा की चोटी पर अनधिकृत ओवरले एक टुकड़ा भीतर के साथ मैं यूट्यूब प्लेयर के साथ एक LinearLayout बढ़ा-चढ़ाकर कर रहा हूँ, इस तरह से:एंड्रॉयड YouTubePlayer खिलाड़ी
fragmentManager = getActivity().getSupportFragmentManager();
fragmentTransaction = fragmentManager.beginTransaction();
player = new YouTubePlayerSupportFragment();
fragmentTransaction.add(R.id.youTubePlayerContainer, player);
fragmentTransaction.commit();
.. जहां youTubePlayerContainer inflated LinearLayout
प्लेयर सही ढंग से पता चला है, खेलना शुरू कर रहा है और दूसरी स्टॉप में है। लॉग निम्नलिखित पता चलता है:
YouTube video playback stopped due to unauthorized overlay on top of player.
The YouTubePlayerView is obscured by [email protected]
YouTubePlayerView is completely covered, with the distance in px between each edge of the obscuring view and the YouTubePlayerView being: left: 484, top: 100, right: 100, bottom: 170..
यह मेरा एक्सएमएल है: (यह के भीतर कोई FrameLayout)
<LinearLayout
android:id="@+id/curtain"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/withApi"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical" >
<LinearLayout
android:id="@+id/youTubePlayerContainer"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_gravity="center"
android:layout_margin="30dp"
android:layout_weight="1"
android:orientation="vertical" >
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="3dp"
android:background="@color/trans_popUp"
android:padding="3dp" >
<TextView
android:id="@+id/textYouTubeVisor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Title..."
android:textColor="@color/white" />
</LinearLayout>
</LinearLayout>
मैं सफलता के बिना मार्जिन को बदलने की कोशिश की। मैं आधिकारिक दस्तावेज पढ़ लेकिन सफलता नहीं मिली इंगित करता है कि FrameLayout है कि समस्या का कारण बनता है: android.widget.FrameLayout @ 4110d1f8 लेकिन इस तरह के एक संदर्भ जो दर्शाता है
किसी वह हुआ करने के लिएकी पहचान नहीं करता है?
मैं किसी भी मदद की सराहना करता हूं।
सादर
प्लेयर डिज़ाइन किया गया है ताकि आप सामग्री या नियंत्रण पर कुछ भी नहीं डाल सकें। चूंकि आप अपने लेआउट में प्लेयर को शामिल नहीं करते हैं, इसलिए मैं केवल यह मान सकता हूं कि लेआउट वीडियो पर आ रहा है, न कि इसके तहत। क्या आप अपना शीर्षक देख सकते हैं ... खेल रहे हैं? –
क्या आपने इस मुद्दे को हल किया? कृपया मुझे बताएं, मैं यहां फंस गया हूं :( – Reyjohn
@ रेज़हॉन मुझे यह हल नहीं हुआ। अगर मुझे कोई समाधान मिल जाए, तो मैं समझाऊंगा। अगर आपको कोई मिल जाए, तो मैं आपको बताने के लिए सराहना करता हूं। – Sergio76