0
비디오보기,미디어 컨트롤러 내가 많은 같은 답변을 많은 주제를 검색
에 표시되지하지만처럼 많은 사람들이 나를 & 근무 보인다 않았다. VideoView.xml
<VideoView
android:alpha="0.5"
android:background="@android:color/transparent"
android:id="@+id/vv_play_video_dialog_detail"
android:layout_height="250dp"
android:layout_width="match_parent"
android:layout_weight="1"
android:visibility="visible"
/>
CcMediaController mMc = new CcMediaController(this);
// FrameLayout.LayoutParams lp = new FameLayout.LayoutParams(
// FrameLayout.LayoutParams.MATCH_PARENT,
// FrameLayout.LayoutParams.WRAP_CONTENT);
// lp.gravity = Gravity.BOTTOM;
// mMc.setLayoutParams(lp);
//
// ((ViewGroup) mMc.getParent()).removeView(mMc);
//
// (new VideoControllerView(this)).addView(mMc);
// set play video view dialog details photo
mMc.setAnchorView(mVvPlayVideoInDetail);
mMc.setMediaPlayer(mVvPlayVideoInDetail);
mVvPlayVideoInDetail.requestFocus();
mVvPlayVideoInDetail.setBackgroundColor(Color.WHITE);
mVvPlayVideoInDetail.setMediaController(mMc);
mVvPlayVideoInDetail.setZOrderOnTop(true);
Put Custom Media Controller into Video View by using setAnchorView()
public class CcMediaController extends MediaController {
ImageButton mCCBtn;
Context mContext;
AlertDialog mLangDialog;
public CcMediaController(Context context) {
super(context);
mContext = context;
}
@Override
public void setAnchorView(View view) {
super.setAnchorView(view);
FrameLayout.LayoutParams frameParams = new FrameLayout.LayoutParams(
LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT);
frameParams.gravity = Gravity.RIGHT|Gravity.TOP;
View v = makeCCView();
addView(v, frameParams);
}
private View makeCCView() {
mCCBtn = new ImageButton(mContext);
mCCBtn.setImageResource(R.drawable.abc_ab_bottom_solid_dark_holo);
mCCBtn.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
Builder builder = new AlertDialog.Builder(mContext);
builder.setSingleChoiceItems(R.array.array, 0, new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
//Save Preference and Dismiss the Dialog here
Toast.makeText(mContext, "Which ::: "+which, Toast.LENGTH_LONG).show();
}
});
mLangDialog = builder.create();
mLangDialog.show();
}
});
return mCCBtn;
}
}
Create Custom Media Controller
show Media Controller on Video View correctly
에 여전히
일을하지,
감사