Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

365
Views
¿Cómo implementar ExoPlayer con enlace de datos?

Tengo un diseño de clase activity_player en el que tengo exoplayer2.ui.PlayerView y creé exo_player_control_view para que anule los controles predeterminados en ExoPlayer. Así que quería usar el enlace de datos en la vista de control personalizada recién creada, pero no sé cómo hacerlo. ¿Algún consejo?

En realidad, es un problema abierto aquí , pero aún no se ha resuelto. Entonces, ¿hay alguien que haya tenido una solución para hacer que exo_player_control_view sea compatible con la vinculación de datos?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Usar así >>>>>

 private val binding by lazy { ActivityPipVideoPlayerBinding.inflate(layoutInflater)} private val exoPLayerBinding by lazy { VdoExoControlViewBinding.inflate(LayoutInflater.from(this), binding.root, true) }
over 4 years ago · Santiago Trujillo Report

0

Puede usar la variable de enlace dentro del fragmento/actividad para acceder a playerView dentro del fragmento/actividad y

 val uri: Uri? = if (url is String) Uri.parse(url as String?) else url as Uri? val trackSelector = DefaultTrackSelector(AdaptiveTrackSelection.Factory(DefaultBandwidthMeter())) val player: SimpleExoPlayer = ExoPlayerFactory.newSimpleInstance(view.context, trackSelector) val dataSourceFactory = DefaultDataSourceFactory(view.context, "ua") val mediaSource = ExtractorMediaSource(uri, dataSourceFactory, DefaultExtractorsFactory(), null, null) player.prepare(mediaSource) player.apply { volume = 0f repeatMode = Player.REPEAT_MODE_ONE playWhenReady = true videoScalingMode = C.VIDEO_SCALING_MODE_SCALE_TO_FIT } binding.playerView.setResizeMode(AspectRatioFrameLayout.RESIZE_MODE_FILL) binding.playerView.player = player
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!