我想在我的应用程序中隐藏/隐藏视频视图的URL。当视频活动在设备上运行时,URL显示在logcat中。我想尽可能地隐藏URL。有没有办法将此输出抑制到logcat?
以下是违规活动:
mVideoView = (VideoView) findViewById(R.id.surface_view);
mVideoView.setMediaController(new MediaController(this));
Bundle b = this.getIntent().getExtras();
path = b.getString("path");
mVideoView.setVideoURI(Uri.parse(path));
答案 0 :(得分:3)
如果你看一下VideoView
的来源,就会看到它调用MediaPlayer.setDataSource(..)
,然后调用URI.getScheme()
和URI.getPath()
。
Sooo,您可以通过继承URI并覆盖Log使用的toString()
来解决您的问题。让它返回一些描述性信息(媒体名称?),但不返回媒体的URL。