本文整理汇总了Java中android.widget.MediaController.setPadding方法的典型用法代码示例。如果您正苦于以下问题:Java MediaController.setPadding方法的具体用法?Java MediaController.setPadding怎么用?Java MediaController.setPadding使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.widget.MediaController
的用法示例。
在下文中一共展示了MediaController.setPadding方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: onCreate
import android.widget.MediaController; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_player);
mVideo = (Video)getIntent().getSerializableExtra(Video.INTENT_EXTRA_VIDEO);
View root = findViewById(R.id.root);
mediaController = new MediaController(this);
//overscan safe on 1980 * 1080 TV
mediaController.setPadding(48, 27, 48, 27);
mediaController.setAnchorView(root);
shutterView = findViewById(R.id.shutter);
surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
preparePlayer();
}
示例2: onCreate
import android.widget.MediaController; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_player);
mVideo = (Video) getIntent().getSerializableExtra(Video.INTENT_EXTRA_VIDEO);
View root = findViewById(R.id.root);
mediaController = new MediaController(this);
//overscan safe on 1980 * 1080 TV
mediaController.setPadding(48, 27, 48, 27);
mediaController.setAnchorView(root);
shutterView = findViewById(R.id.shutter);
surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
preparePlayer();
}
示例3: onCreate
import android.widget.MediaController; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Log.d(TAG, "onCreate()");
setContentView(R.layout.activity_player);
mVideo = (Video) getIntent().getSerializableExtra(Video.INTENT_EXTRA_VIDEO);
// We will use the PlaybackOverlayFragment when running on TV.
mIsOnTv = MyUtil.isRunningInTvMode(this);
if (mIsOnTv) {
// On TV we will use the resource in layout-televsion
mPlaybackOverlayFragment = (PlaybackOverlayFragment)
getFragmentManager().findFragmentById(R.id.playback_controls_fragment);
} else {
shutterView = findViewById(R.id.shutter);
View root = findViewById(R.id.root);
mediaController = new MediaController(this);
//overscan safe on 1980 * 1080 TV
mediaController.setPadding(48, 27, 48, 27);
mediaController.setAnchorView(root);
}
surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
preparePlayer();
}
示例4: onCreate
import android.widget.MediaController; //导入方法依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_player);
View root = findViewById(R.id.root);
mediaController = new MediaController(this);
//overscan safe on 1980 * 1080 TV
mediaController.setPadding(48, 27, 48, 27);
mediaController.setAnchorView(root);
shutterView = findViewById(R.id.shutter);
surfaceView = (VideoSurfaceView) findViewById(R.id.surface_view);
surfaceView.getHolder().addCallback(this);
SampleSource sampleSource =
new FrameworkSampleSource(this, Uri.parse(url), /* headers */ null, RENDERER_COUNT);
// Build the track renderers
videoRenderer = new MediaCodecVideoTrackRenderer(sampleSource, MediaCodec.VIDEO_SCALING_MODE_SCALE_TO_FIT);
TrackRenderer audioRenderer = new MediaCodecAudioTrackRenderer(sampleSource);
// Setup the player
player = ExoPlayer.Factory.newInstance(RENDERER_COUNT, 1000, 5000);
player.addListener(this);
// Build the player controls
mediaController.setMediaPlayer(new PlayerControl(player));
mediaController.setEnabled(true);
player.prepare(videoRenderer, audioRenderer);
}