mirror of
https://gitlab.futo.org/videostreaming/grayjay.git
synced 2025-04-29 22:24:29 +02:00
chapters ui on text press
This commit is contained in:
parent
3c05521a5b
commit
b652597924
@ -404,6 +404,10 @@ class VideoDetailView : ConstraintLayout {
|
|||||||
_monetization = findViewById(R.id.monetization);
|
_monetization = findViewById(R.id.monetization);
|
||||||
_player.attachPlayer();
|
_player.attachPlayer();
|
||||||
|
|
||||||
|
_player.onChapterClicked.subscribe {
|
||||||
|
showChaptersUI();
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
_buttonSubscribe.onSubscribed.subscribe {
|
_buttonSubscribe.onSubscribed.subscribe {
|
||||||
_slideUpOverlay = UISlideOverlays.showSubscriptionOptionsOverlay(it, _overlayContainer);
|
_slideUpOverlay = UISlideOverlays.showSubscriptionOptionsOverlay(it, _overlayContainer);
|
||||||
@ -863,6 +867,22 @@ class VideoDetailView : ConstraintLayout {
|
|||||||
_cast.stopAllGestures();
|
_cast.stopAllGestures();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun showChaptersUI(){
|
||||||
|
video?.let {
|
||||||
|
try {
|
||||||
|
_chapters?.let {
|
||||||
|
if(it.size == 0)
|
||||||
|
return@let;
|
||||||
|
_container_content_chapters.setChapters(_chapters);
|
||||||
|
switchContentView(_container_content_chapters);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
catch(ex: Throwable) {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
fun updateMoreButtons() {
|
fun updateMoreButtons() {
|
||||||
val isLimitedVersion = video?.url != null && StatePlatform.instance.getContentClientOrNull(video!!.url)?.let {
|
val isLimitedVersion = video?.url != null && StatePlatform.instance.getContentClientOrNull(video!!.url)?.let {
|
||||||
if (it is JSClient)
|
if (it is JSClient)
|
||||||
@ -879,15 +899,7 @@ class VideoDetailView : ConstraintLayout {
|
|||||||
_chapters?.let {
|
_chapters?.let {
|
||||||
if(it != null && it.size > 0)
|
if(it != null && it.size > 0)
|
||||||
RoundButton(context, R.drawable.ic_list, "Chapters", TAG_CHAPTERS) {
|
RoundButton(context, R.drawable.ic_list, "Chapters", TAG_CHAPTERS) {
|
||||||
video?.let {
|
showChaptersUI();
|
||||||
try {
|
|
||||||
_container_content_chapters.setChapters(_chapters);
|
|
||||||
switchContentView(_container_content_chapters);
|
|
||||||
}
|
|
||||||
catch(ex: Throwable) {
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
else null
|
else null
|
||||||
},
|
},
|
||||||
|
@ -145,6 +145,8 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
|||||||
val onVideoClicked = Event0();
|
val onVideoClicked = Event0();
|
||||||
val onTimeBarChanged = Event2<Long, Long>();
|
val onTimeBarChanged = Event2<Long, Long>();
|
||||||
|
|
||||||
|
val onChapterClicked = Event1<IChapter>();
|
||||||
|
|
||||||
@OptIn(UnstableApi::class)
|
@OptIn(UnstableApi::class)
|
||||||
constructor(context: Context, attrs: AttributeSet? = null) : super(PLAYER_STATE_NAME, context, attrs) {
|
constructor(context: Context, attrs: AttributeSet? = null) : super(PLAYER_STATE_NAME, context, attrs) {
|
||||||
LayoutInflater.from(context).inflate(R.layout.video_view, this, true);
|
LayoutInflater.from(context).inflate(R.layout.video_view, this, true);
|
||||||
@ -185,6 +187,12 @@ class FutoVideoPlayer : FutoVideoPlayerBase {
|
|||||||
_control_duration_fullscreen = _videoControls_fullscreen.findViewById(R.id.text_duration);
|
_control_duration_fullscreen = _videoControls_fullscreen.findViewById(R.id.text_duration);
|
||||||
_control_pause_fullscreen = _videoControls_fullscreen.findViewById(R.id.button_pause);
|
_control_pause_fullscreen = _videoControls_fullscreen.findViewById(R.id.button_pause);
|
||||||
|
|
||||||
|
_control_chapter.setOnClickListener {
|
||||||
|
_currentChapter?.let {
|
||||||
|
onChapterClicked.emit(it);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
val castVisibility = if (Settings.instance.casting.enabled) View.VISIBLE else View.GONE
|
val castVisibility = if (Settings.instance.casting.enabled) View.VISIBLE else View.GONE
|
||||||
_control_cast.visibility = castVisibility
|
_control_cast.visibility = castVisibility
|
||||||
_control_cast_fullscreen.visibility = castVisibility
|
_control_cast_fullscreen.visibility = castVisibility
|
||||||
|
Loading…
x
Reference in New Issue
Block a user