Java Code Examples for com.google.android.exoplayer.ExoPlaybackException#printStackTrace()

The following examples show how to use com.google.android.exoplayer.ExoPlaybackException#printStackTrace() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: VLCRendererBuilder.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
@Override
public void buildRenderers(DemoPlayer player, RendererBuilderCallback callback) {
    TrackRenderer[] renderers = new TrackRenderer[DemoPlayer.RENDERER_COUNT];
    try {
        VLCSampleExtractor extractor = new VLCSampleExtractor(vlc, uri);
        VLCSampleSource vlcsource = new VLCSampleSource(extractor);

        MySurfaceLayoutHandler msh = null;
        System.out.println("VLCRendererBuilder.buildRenderers() props = "+props);
        Object v = props.get(SURFACE_VIEW_RES_ID_PROP);

        if (v instanceof Integer)
            msh = new MySurfaceLayoutHandler(this.context, ((Integer) v).intValue());

        if (msh == null)
            callback.onRenderersError(new ExoPlaybackException("property " + SURFACE_VIEW_RES_ID_PROP + " not set"));


        VLCVideoSurfaceHandler ivdoplayer = new VLCVideoSurfaceHandler( extractor.getLibVLC(),
                player.getMainHandler(), player, msh);

        renderers[DemoPlayer.TYPE_VIDEO] = new VLCVideoTrackRenderer(vlcsource, player.getMainHandler(), player,
                ivdoplayer, extractor.getLibVLC());
        renderers[DemoPlayer.TYPE_AUDIO] = new VLCAudioTrackRenderer(vlcsource, player.getMainHandler(), player,
                extractor.getLibVLC());
    } catch (ExoPlaybackException e) {
        e.printStackTrace();
    }
    callback.onRenderers(null, null, renderers);
}
 
Example 2
Source File: VideoActivity.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
/*************
  * Player
  *************/
 LibVLC getLibVLC(){
 	if(true)
try {
	return com.exovlc.ExoVlcUtil.getVLC(this);
} catch (ExoPlaybackException e1) {
	// TODO Auto-generated catch block
	e1.printStackTrace();
	finish();
}
throw new IllegalStateException();
 }
 
Example 3
Source File: PlayerActivity.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
private RendererBuilder getRendererBuilder() {
  String userAgent = DemoUtil.getUserAgent(this);
  switch (contentType) {
    case DemoUtil.TYPE_SS:
      return new SmoothStreamingRendererBuilder(userAgent, contentUri.toString(), contentId,
          new SmoothStreamingTestMediaDrmCallback(), debugTextView);
    case DemoUtil.TYPE_DASH:
      return new DashRendererBuilder(userAgent, contentUri.toString(), contentId,
          new WidevineTestMediaDrmCallback(contentId), debugTextView);
    case DemoUtil.TYPE_HLS:
      return new HlsRendererBuilder(userAgent, contentUri.toString(), contentId);
    case DemoUtil.TYPE_RAW_HTTP_TS:
    case DemoUtil.TYPE_RAW_HTTP_MP4:
  	  try {
	System.out.println(">>>>  PlayerActivity.getRendererBuilder()ACTIVE_VLC_TEST_BUILDER =  "+ACTIVE_VLC_TEST_BUILDER);
	if (ACTIVE_VLC_TEST_BUILDER)
	{
		Properties p  = new Properties();
		p.put(com.exovlc.demo.VLCRendererBuilder.SURFACE_VIEW_RES_ID_PROP,  Integer.valueOf(R.id.surface_view) );
		return  new com.exovlc.demo.VLCRendererBuilder(this,   contentUri ,p);
	}
 return new RawHttpRendererBuilder(this, userAgent, contentUri.toString(), debugTextView, contentType);
} catch (ExoPlaybackException e) {
	// TODO Auto-generated catch block
	e.printStackTrace();
}
    case DemoUtil.TYPE_UDP:
      return new UdpMulticastRendererBuilder(this, userAgent, contentUri.toString(), debugTextView, contentType);
    case DemoUtil.TYPE_RTP:
      return new UdpRtpRendererBuilder(this, userAgent, contentUri.toString(), debugTextView, contentType);
    case DemoUtil.TYPE_UDP_UNICAST:
      return new UdpUnicastRendererBuilder(this, userAgent, contentUri.toString(), debugTextView, contentType);
    default:
      return new DefaultRendererBuilder(this, contentUri, debugTextView);
  }
}
 
Example 4
Source File: VLCRendererBuilder.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
@Override
public void buildRenderers(DemoPlayer player, RendererBuilderCallback callback) {
    TrackRenderer[] renderers = new TrackRenderer[DemoPlayer.RENDERER_COUNT];
    try {
        VLCSampleExtractor extractor = new VLCSampleExtractor(vlc, uri);
        VLCSampleSource vlcsource = new VLCSampleSource(extractor);

        MySurfaceLayoutHandler msh = null;
        System.out.println("VLCRendererBuilder.buildRenderers() props = "+props);
        Object v = props.get(SURFACE_VIEW_RES_ID_PROP);

        if (v instanceof Integer)
            msh = new MySurfaceLayoutHandler(this.context, ((Integer) v).intValue());

        if (msh == null)
            callback.onRenderersError(new ExoPlaybackException("property " + SURFACE_VIEW_RES_ID_PROP + " not set"));


        VLCVideoSurfaceHandler ivdoplayer = new VLCVideoSurfaceHandler( extractor.getLibVLC(),
                player.getMainHandler(), player, msh);

        renderers[DemoPlayer.TYPE_VIDEO] = new VLCVideoTrackRenderer(vlcsource, player.getMainHandler(), player,
                ivdoplayer, extractor.getLibVLC());
        renderers[DemoPlayer.TYPE_AUDIO] = new VLCAudioTrackRenderer(vlcsource, player.getMainHandler(), player,
                extractor.getLibVLC());
    } catch (ExoPlaybackException e) {
        e.printStackTrace();
    }
    callback.onRenderers(null, null, renderers);
}
 
Example 5
Source File: VLCRendererBuilder.java    From Exoplayer_VLC with Apache License 2.0 5 votes vote down vote up
@Override
public void buildRenderers(DemoPlayer player, RendererBuilderCallback callback) {
	TrackRenderer[] renderers = new TrackRenderer[DemoPlayer.RENDERER_COUNT];
	try {
		VLCSampleExtractor extractor = new VLCSampleExtractor(vlc, uri);
		VLCSampleSource vlcsource = new VLCSampleSource(extractor);

		MySurfaceLayoutHandler msh = null;
		System.out.println("VLCRendererBuilder.buildRenderers() props = "+props);
			Object v = props.get(SURFACE_VIEW_RES_ID_PROP);
	  
			if (v instanceof Integer)
				msh = new MySurfaceLayoutHandler(this.context, ((Integer) v).intValue());
		 
		if (msh == null)
			callback.onRenderersError(new ExoPlaybackException("property " + SURFACE_VIEW_RES_ID_PROP + " not set"));
		
		
		VLCVideoSurfaceHandler ivdoplayer = new VLCVideoSurfaceHandler( extractor.getLibVLC(),
				player.getMainHandler(), player, msh);

		renderers[DemoPlayer.TYPE_VIDEO] = new VLCVideoTrackRenderer(vlcsource, player.getMainHandler(), player,
				ivdoplayer, extractor.getLibVLC());
		renderers[DemoPlayer.TYPE_AUDIO] = new VLCAudioTrackRenderer(vlcsource, player.getMainHandler(), player,
				extractor.getLibVLC());
	} catch (ExoPlaybackException e) {
		e.printStackTrace();
	}
	callback.onRenderers(null, null, renderers);
}