media player: setSurface() inside a try-catch blog

This commit is contained in:
Andrew Dolgov 2017-06-05 12:02:39 +03:00
parent 4e2de4fa87
commit 05e18bd218

View File

@ -1307,9 +1307,9 @@ public class HeadlinesFragment extends Fragment {
holder.flavorVideoView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() { holder.flavorVideoView.setSurfaceTextureListener(new TextureView.SurfaceTextureListener() {
@Override @Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) { public void onSurfaceTextureAvailable(SurfaceTexture surface, int width, int height) {
m_mediaPlayer.setSurface(new Surface(surface));
try { try {
m_mediaPlayer.setSurface(new Surface(surface));
m_mediaPlayer.setDataSource(article.flavorStreamUri); m_mediaPlayer.setDataSource(article.flavorStreamUri);
m_mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() { m_mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {