Skip to content

Same video being played (caching/cleanup issue?) #6

@beolson001

Description

@beolson001

I'm trying to set up a list of videos.
I recently integrated the Kaltura android sdk and I'm able to play video via the PlayerViewerController.
I have a list view of videos.
Selecting the initial list item will play the expected video.
However, when I switch to another video... the first selected video is shown... as if it were cached. If I wait a period of time, the correct video will be shown when selected.

Is there some cleanup I need to do when closing the first video?

private PlayerViewController mPlayerView;

@Override
protected void initLocalActivity() {
    setContentView(R.layout.activity_library_item_video_kaltura);

    mPlayerView = (PlayerViewController) findViewById(R.id.pvcLibaryVideoKaltura);
    mPlayerView.setActivity(this);

    // select video
    String videoId = getIntent().getExtras().getString(KeyManager.KEY_LIBRARY_ITEM, "not found");
    Log.d(TAG, TAG + " video id: " + videoId);

    if (videoId.equalsIgnoreCase("0")) {
        mPlayerView.addComponents("1768201", "0_nge2sq8u", this);

    } else if (videoId.equalsIgnoreCase("1")) {
        mPlayerView.addComponents("1768201", "1_uwp3q4jk", this);

    } else if (videoId.equalsIgnoreCase("2")) {
        mPlayerView.addComponents("1768201", "1_kejmejot", this);
    } else {
        mPlayerView.addComponents("1768201", "0_fnioliix", this);
    }

}

@Override
public void onBackPressed() {
    super.onBackPressed();
    Log.d(TAG, TAG + " back pressed.");
    mPlayerView.stop();
    mPlayerView = null;
    finish();

}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions