Showing
1 changed file
with
8 additions
and
0 deletions
| @@ -12,9 +12,11 @@ import android.os.Handler; | @@ -12,9 +12,11 @@ import android.os.Handler; | ||
| 12 | import android.view.KeyEvent; | 12 | import android.view.KeyEvent; |
| 13 | import android.view.View; | 13 | import android.view.View; |
| 14 | import android.widget.TextView; | 14 | import android.widget.TextView; |
| 15 | +import android.widget.Toast; | ||
| 15 | import android.widget.VideoView; | 16 | import android.widget.VideoView; |
| 16 | import com.gimi.common.cinema.model.Constant; | 17 | import com.gimi.common.cinema.model.Constant; |
| 17 | import com.gimi.common.cinema.utils.OpenMMUtils; | 18 | import com.gimi.common.cinema.utils.OpenMMUtils; |
| 19 | +import com.gimi.common.cinema.utils.SambaFileCharge; | ||
| 18 | import com.gimi.common.cinema.utils.Utils; | 20 | import com.gimi.common.cinema.utils.Utils; |
| 19 | import com.xgimi.gimicinema.R; | 21 | import com.xgimi.gimicinema.R; |
| 20 | 22 | ||
| @@ -48,6 +50,12 @@ public class AdsPreVideoPlayerActivity extends BaseActivity { | @@ -48,6 +50,12 @@ public class AdsPreVideoPlayerActivity extends BaseActivity { | ||
| 48 | timeCount = (TextView) findViewById(R.id.promoteTv); | 50 | timeCount = (TextView) findViewById(R.id.promoteTv); |
| 49 | playUrl = getAdsVideoUrl(); | 51 | playUrl = getAdsVideoUrl(); |
| 50 | videoPath = getIntent().getStringExtra(MOVIE_PLAY_PATH); | 52 | videoPath = getIntent().getStringExtra(MOVIE_PLAY_PATH); |
| 53 | + if (!SambaFileCharge.fileExist(playUrl)) { | ||
| 54 | + Toast.makeText(this, "映前广告不存在,请设置", Toast.LENGTH_SHORT).show(); | ||
| 55 | + OpenMMUtils.openPlayer(AdsPreVideoPlayerActivity.this, videoPath, 0); | ||
| 56 | + AdsPreVideoPlayerActivity.this.finish(); | ||
| 57 | + return; | ||
| 58 | + } | ||
| 51 | Uri videoUri = Uri.parse(playUrl); | 59 | Uri videoUri = Uri.parse(playUrl); |
| 52 | videoView.setVideoURI(videoUri); | 60 | videoView.setVideoURI(videoUri); |
| 53 | videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { | 61 | videoView.setOnCompletionListener(new MediaPlayer.OnCompletionListener() { |
Please
register
or
login
to post a comment