Skip to content

Commit

Permalink
fix(android): add accessor for Ti.Media.fullscreen property, default …
Browse files Browse the repository at this point in the history
…initialPlaybackTime to 0
  • Loading branch information
sgtcoolguy committed Nov 2, 2020
1 parent 48006b6 commit 204827d
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ public class VideoPlayerProxy extends TiViewProxy implements TiLifecycle.OnLifec
private int playbackState = MediaModule.VIDEO_PLAYBACK_STATE_STOPPED;
private int repeatMode = MediaModule.VIDEO_REPEAT_MODE_NONE;

private boolean fullscreen = false;

// Used only if TiVideoActivity is used (fullscreen == true)
private Handler videoActivityHandler;
private WeakReference<Activity> activityListeningTo = null;
Expand All @@ -95,6 +97,7 @@ public VideoPlayerProxy()
defaultValues.put(TiC.PROPERTY_DURATION, 0);
defaultValues.put(TiC.PROPERTY_END_PLAYBACK_TIME, 0); // match duration
defaultValues.put(TiC.PROPERTY_PLAYABLE_DURATION, 0); // match duration
defaultValues.put(TiC.PROPERTY_INITIAL_PLAYBACK_TIME, 0);
}

@Override
Expand Down Expand Up @@ -163,7 +166,6 @@ public void handleCreationDict(KrollDict options)
// whether we use a TiVideoActivity versus a standard
// embedded view. Setting "fullscreen" after this currently
// has no effect.
boolean fullscreen = false;
Object fullscreenObj = options.get(TiC.PROPERTY_FULLSCREEN);
if (fullscreenObj != null) {
fullscreen = TiConvert.toBoolean(fullscreenObj);
Expand Down Expand Up @@ -281,6 +283,12 @@ public void start()
play();
}

@Kroll.getProperty
public boolean getFullscreen()
{
return fullscreen;
}

@Kroll.method
public void pause()
{
Expand Down

0 comments on commit 204827d

Please sign in to comment.