henryblue/MxVideoPlayer

error void onCompletion

Closed this issue · 5 comments

hi

my problem.. after clicking icon error auto close windows

I want change action "auto close windows" to try playing again after click icon

1 4

after add code .. get error

@OverRide
public void onCompletion() {
if (mCurrentState == CURRENT_STATE_ERROR) {
// add the logic you need
}
if ("quit fullscreen") {
super.onCompletion();
}
}

untitled

what problem?

can write code for try play video again

i use simple project https://github.com/henryblue/MxVideoPlayer/tree/master/app

this all file lib ..what file edit

sssss

Thanks a lot

the code is only tip, "quit fullscreen" is also only code annotation. You can change it as follows:
boolean mIsQuitFullscreen = false;
@OverRide
public void onCompletion() {
if (mIsQuitFullscreen) {
super.onCompletion();
} else {
// what you want to do
}
}

@Override
public boolean quitFullscreenOrTinyListener() {
    mIsQuitFullscreen = true;
    boolean result = super.quitFullscreenOrTinyListener();
    mIsQuitFullscreen = false;
    return result;
}

This will still have some problems, i will fix this bug in the next version.

Good Now work for v 1.1.0

but .. see other problem .. after click button back .. back 2 activity auto ..me click one only

why ?

and

I want other

how fill screen ? no need black background

picsart_02-18-05 47 40

About "how fill screen ? no need black background", you can do that:
@OverRide
public void onVideoSizeChanged() {
MxMediaManager.getInstance().mCurVideoWidth = getMeasuredWidth();
MxMediaManager.getInstance().mCurVideoHeight = getMeasuredHeight();
super.onVideoSizeChanged();
}

About "after click button back .. back 2 activity auto ..me click one only".
I do not understand what you mean, hope you can describe in detail

About "after click button back.. back 2 activity auto.. me click one only". The fix has done..

Another question ..

after use

public void onVideoSizeChanged() {
MxMediaManager.getInstance().mCurVideoWidth = getMeasuredWidth();
MxMediaManager.getInstance().mCurVideoHeight = getMeasuredHeight();
super.onVideoSizeChanged();
}

work for landscape and portrait screen.. I want to work in landscape only and portrait work for default Size.. can do this ?

Thanks a lot :)

Unfortunately, it is impossible to achieve all the needs, I do not want the logic of the player is too complicated. You can read the source code to see how to modify. Thanks