Skip to content

Getting error in .setCache(ApplicationClass.getInstance().simpleCache)  #2

Description

@AsitDixit
   public void initVideoPlayer() {
        player = new ExoPlayer.Builder(context).build();
        ProgressiveMediaSource mediaSource = new ProgressiveMediaSource.Factory(
            new CacheDataSource.Factory()
                .setCache(ApplicationClass.getInstance().simpleCache)
                .setUpstreamDataSourceFactory(new DefaultHttpDataSource.Factory()
                    .setUserAgent("ExoplayerDemo"))
                .setFlags(CacheDataSource.FLAG_IGNORE_CACHE_ON_ERROR)
            ).createMediaSource(MediaItem.fromUri(mediaURI));
	
        playerView.setPlayer(player);
        player.setMediaSource(mediaSource);
        player.prepare();
    }

I'm getting error in Applicationclass in above code. I changed that to SimpleMediaPlayer got an error error: cannot find symbol.setCache(SimpleMediaPlayer.getInstance().simpleCache)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions