0

Iam playing a video playlist using android textureview, every time a movie gets finished i listen for the endstate reload the data source and play the next video . Iam using EXOPLAYER and sending the surface of the textureview to the player . The playlist works fine but some times when switching between videos, the video doesnot display only the audio is displayed , and also after running for 30 minutes the device restarts . Can someone please help me find out the cause for this . thankyou ..Iam attaching the relevant code

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.adplayertexture);   
        AdplayerTexture=(TextureView)findViewById(R.id.AdPlayerTexture);
        AdplayerTexture.setBackgroundColor(Color.BLACK);
            AdplayerTexture.setSurfaceTextureListener(this);
      }
@Override
public void onSurfaceTextureAvailable(SurfaceTexture surface, int width,
        int height) {

     AdPlayerSurface = new Surface( surface); 
     playMedia(AdPlayerSurface);
}


private void playMedia(Surface surface){
    mediaplayer=new ExoPlayer();
    mediaplayer.play(this,Videopathlist[CurrentVideoIndex],surface;
     mediaplayer.addListener(this);   
   }

@Override
public void onStateChanged(boolean playWhenReady, int playbackState) {

    if (playbackState == ExoPlayer.STATE_ENDED) {
    //releasing the resources   
        mediaplayer.DestroyPlayer();
    AdPlayerSurface.release();

    AdPlayerSurface=new Surface(AdplayerTexture.getSurfaceTexture());
        CurrentVideoIndex++;
    playMedia(AdPlayerSurface);
    }
user2949215
  • 663
  • 1
  • 7
  • 11
  • If the device is restarting, that's a platform or OEM driver bug. File a report on http://b.android.com/ with the logcat output at the point of the restart and some information about the device (device type, OS version, etc). – fadden Dec 31 '14 at 17:05
  • thankyou i will do that. the log cat error when the video isn't playing is Acodec [OMX.qcom.video.decoder.avc] storeMetaDataInBuffers failed w/ err -2147483648 but after a few seconds the video plays . can you guide me regarding this ? – user2949215 Jan 01 '15 at 07:10
  • 1
    http://stackoverflow.com/questions/24998493/media-codec-4-1-issue – fadden Jan 01 '15 at 16:58

0 Answers0