fix sharing of article videos; do not crash if prepareasync has already been called
This commit is contained in:
parent
792f7cc722
commit
8e53a7aa88
@ -143,7 +143,11 @@ public class VideoPlayerActivity extends CommonActivity {
|
|||||||
@Override
|
@Override
|
||||||
public void surfaceCreated(SurfaceHolder holder) {
|
public void surfaceCreated(SurfaceHolder holder) {
|
||||||
mediaPlayer.setDisplay(holder);
|
mediaPlayer.setDisplay(holder);
|
||||||
mediaPlayer.prepareAsync();
|
try {
|
||||||
|
mediaPlayer.prepareAsync();
|
||||||
|
} catch (IllegalStateException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
mediaPlayer.setOnPreparedListener(new MediaPlayer.OnPreparedListener() {
|
||||||
@Override
|
@Override
|
||||||
public void onPrepared(MediaPlayer mp) {
|
public void onPrepared(MediaPlayer mp) {
|
||||||
@ -238,6 +242,7 @@ public class VideoPlayerActivity extends CommonActivity {
|
|||||||
if (m_streamUri != null) {
|
if (m_streamUri != null) {
|
||||||
Intent intent = new Intent(Intent.ACTION_SEND);
|
Intent intent = new Intent(Intent.ACTION_SEND);
|
||||||
|
|
||||||
|
intent.setType("text/plain");
|
||||||
intent.putExtra(Intent.EXTRA_SUBJECT, m_streamUri);
|
intent.putExtra(Intent.EXTRA_SUBJECT, m_streamUri);
|
||||||
intent.putExtra(Intent.EXTRA_TEXT, m_streamUri);
|
intent.putExtra(Intent.EXTRA_TEXT, m_streamUri);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user