youtube - Resize video when scaling/minimizing YoutubePlayerView in android -
I can make the YouTube player view minimized to the bottom right, where to build the functionality of YouTube, given below The tutorial has followed the link in the hand corner of the screen.
However, the video is not currently on a low window-size scale and maintains the original size.
How do I update the YouTube player Wipe to change the size of the video to replace with scaling?
view.xml:
Android: Android: id = "@ + id / container" Android: layout_width = "match_parent" Android: layout_height = "match_parent" & gt; ; & Lt; Com.example.views.YoutubeVideoViewAndroid: id = "@ + id / youtubeLayout" Android: layout_width = "match_parent" Android: layout_height = "match_parent" Android: orientation = "vertical" Android: visibility = "visible" & gt; & Lt; Com.google.android.youtube.player.YouTubePlayerView Android: id = "@ + id / youtube_fragment" android: layout_width = "match_parent" android: layout_height = "wrap_content" /> & Lt; Android: layout_height = "match_parent" Android: background = "# FF00FF" Android: Gravity = "Center" Android: Tag = "desc" Android: id = "@ + id / viewDesc" android: Text = "Loreum Loreum" Android: textColor = "@ android: color / white" Android: textSize = "35sp" /> & Lt; /com.example.views.YoutubeVideoView> & Lt; / FrameLayout & gt;
DragHelperCallback which is included in my YoutubeVideoView class, which extends the ViewGroup:
Private Class DragHelperCallback extends ViewDragHelper.Callback {@Override Public Boolean TryCaptureView (child) See, int pointer id) {return child == mVideoView; } @ Override Public Zero View View View (see changed view, gap left, integer, top, interval), {mTop = top; MDragOffset = (float) header / emigrange; MVideoView.setPivotX (mVideoView.getWidth ()); MVideoView.setPivotY (mVideoView.getHeight ()); MVideoView.setScaleX (1 - MDRAg Offset / 2); MVideoView.setScaleY (1 - mDragOffset / 2); MDescView.setAlpha (1 - Underground offset); RequestLayout (); } @ Override Public Viewed on Zero (see released child, Float Axwell, Flat Aval) {int top = getPaddingTop (); If (yvel> 0 || (yvel == 0 & amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp; amp ;, 0.5f)); {top + = mDragRange; } MDragHelper.settleCapturedViewAt (Released Group (Top), Top); } @ Override Public Interview Written Children (see Children) {Return MDRRGrange; } @ Override Public-Ent Clamp VivPetivartical (see child, int top, int day) {Final integer boundbound = milling pedestop (); Ultimate ballball = DatHight () - mVideoView.getHeight () - mVideoView.getPaddingBottom (); The final difference is newtop = math. (Math. Max (top, top bound), bottom bound); Make a new comeback; }}
The overview on layout method is in my YouTube video video class, which increases ViewGroup
@Override Layout on Secure Zero (Boolean change) Gone, intl, int t, int r, int b) {mDragRange = getHyight () - mVideoView.getHeight (); MVideoView.layout (0, MTOP, R, MTOP + mVideoView.getMeasuredHeight ()); MDescView .layout (0, MTop + mVideoView.getMeasuredHeight (), R, MTOP + B); }
I know this is old but I'm using a dragable panel There was a similar problem. DraggablePanel is based off of ViewDragHelper if you adjust the height and width layout parameters for YouTubePlayerView, also adjust video games I do not know that visual scaling does not accommodate playing video. I'll talk more about your solution in DraggablePanel Library too will help you a lot.
Comments
Post a Comment