Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual playback controller in java #148

Open
greenenvy opened this issue Apr 16, 2021 · 0 comments
Open

Manual playback controller in java #148

greenenvy opened this issue Apr 16, 2021 · 0 comments

Comments

@greenenvy
Copy link

Can someone help me to transition this code to java? I have trouble with it.

kohii.setUp(videoUrl) {
      tag = videoUrl
      controller = object : Controller {
        override fun kohiiCanStart(): Boolean = true
        override fun kohiiCanPause(): Boolean = true

        override fun setupRenderer(
          playback: Playback,
          renderer: Any?
        ) {
          if (renderer is PlayerView) {
            renderer.useController = true
            renderer.setControlDispatcher(kohii.createControlDispatcher(playback))
          }
        }

        override fun teardownRenderer(
          playback: Playback,
          renderer: Any?
        ) {
          if (renderer is PlayerView) {
            renderer.useController = false
            renderer.setControlDispatcher(null)
          }
        }
      }
    }
      .bind(playerView)

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant