Code Monkey home page Code Monkey logo

Comments (5)

wvanhaevre avatar wvanhaevre commented on August 27, 2024

When changing the source on the player you 'reset' the player. This implies that the ready_state is also reset en will only be updated once new ready_states are reached, i.e. playback is started/continued. The same applies to onTimeUpdate events. This event indicates changes in the 'currentTime' of the player, so when the player is in a 'playing' mode, updating the currentTime. From the described use-case it sounds like you set a new source and pause the player. As a result ready_state changes and timeUpdate events will start to appear once the player starts playing again. If you would do a seek without changing the source, it would indeed make sense to trigger these events as they indicate a state change on the current player instance.
What is the use-case that needs to be handled by the events you are expecting? Maybe a different approach could provide the required info?

from react-native-theoplayer.

janvandertaelen avatar janvandertaelen commented on August 27, 2024

In our use-case we are switching from a live stream to an open-replay stream. When the user pauses the live stream he will end up in an open-replay stream that is paused. The source changes when transitioning to the open-replay stream. We also receive a position that we need to seek to. At this time the user should see the last frame on the player that is paused. Now no frame is shown and only when the user starts the playback the stream is shown.

from react-native-theoplayer.

wvanhaevre avatar wvanhaevre commented on August 27, 2024

Does the simple workaround of briefly starting and stopping playback of the second stream (e.g. till first timeUpdate event) to show the first frame suffice for now to support your use case?

from react-native-theoplayer.

tvanlaerhoven avatar tvanlaerhoven commented on August 27, 2024

@janvandertaelen did the work-around help you out?

from react-native-theoplayer.

janvandertaelen avatar janvandertaelen commented on August 27, 2024

Workaround works but is not ideal.

setPlayerIsPaused(false); setTimeout(() => { setPlayerIsPaused(true); }, 1);

we are doing this when a new source is loaded. If you can fix that after a new source is loaded that onReadyStateChange is called it would remove our dirty hack.

from react-native-theoplayer.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.