kaltura / player-sdk-native-android

Kaltura Android Player SDK
http://player.kaltura.com
GNU Affero General Public License v3.0
93 stars 55 forks source link

Wrong video playing. Caching or cleanup issue? #7

Closed beolson001 closed 9 years ago

beolson001 commented 9 years ago

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();

}

}

InbarItay commented 9 years ago

Hi, In order to switch the media mid way through you can use the the following code example: JSONObject obj = new JSONObject(); obj.put("entryId","0_fnioliix"); mPlayerView.sendNotification("changeMedia", obj);

please make sure you are using HTML 5 version 2.20+ as well. ( i.e HTML5 URL should be: "/html5/html5lib/v2.20/mwEmbedFrame.php")

Regards, Itay

hoangtu23 commented 9 years ago

@InbarItay My logs show : /html5/html5lib/v2.1.1/mwEmbedFrame.php How to upgrade it to v2.20 ? My phone is Nexus 5, Android 5.0.1

Thanks, Tu

jessp01 commented 9 years ago

Hello,

What version of CE are you running?

hoangtu23 commented 9 years ago

@jessp01 Sorry, CE stands for? -.-

KalturaCommunity-zz commented 9 years ago

Community Edition. i.e - which version of the Kaltura server are you running?

May the source be with you,

Jess Portnoy

Join us for the Kaltura Connect Virtual Summits 2015 - Register now! connect.kaltura.com

On Wed, 1 Apr 2015, hoangtu23 wrote:

@jessp01 Sorry, CE stands for? -.-

— Reply to this email directly or view it on GitHub.[ACH7Xrki7CWIr7tcAoadBKrySJ4DuMmIks5n66N9gaJpZM4C-uYo.gif]

hoangtu23 commented 9 years ago

I got PlayerSDK from here: https://github.com/kaltura/AndroidReferenceApp

hoangtu23 commented 9 years ago

@jessp01 @InbarItay @KalturaCommunity I've tried to use new SDK by Android Studio: no more caching issue. Do you have projects support Eclipse?

jessp01 commented 9 years ago

Hello,

Support on what level? Also, for additional questions, please post to forum.kaltura.org instead. Thanks,