Git Product home page Git Product logo

Comments (4)

kiall avatar kiall commented on June 21, 2024 1

Something like this is what you want for calling out and getting the cutpoints, though it probably needs splitting up a bit, as we would need the addMessageListener just once, but the ability to fetch the cutpoints multiple times:

    HtspMessage message = new HtspMessage();
    message.put("method", "getDvrCutpoints");
    message.put("id", Integer.parseInt(recordingUri.getPath().substring(1)));

    try {
        mConnection.addMessageListener(new HtspMessage.Listener() {
            @Override
            public Handler getHandler() {
                return null;
            }

            @Override
            public void onMessage(@NonNull HtspMessage message) {
                HtspMessage[] cutpoints = message.getHtspMessageArray("cutpoints", null);

                // TODO: Null check...

                for (HtspMessage cutpoint : cutpoints) {
                    Log.d(TAG,"Cutpoint: Type=" + message.getInteger("type"));
                }
            }
        });
        mConnection.sendMessage(message);
    } catch (HtspNotConnectedException e) {
        e.printStackTrace();
    }

As for where it belongs, humm. I suspect TvheadendPlayer is currently the right place for the parsed data to end up - it's the player, and it should be responsible for monitoring the current presentation timestamp, and triggering the seek where necessary. The code above can be called from TvheadendPlayer.buildHtspRecordingMediaSource or maybe TvheadendPlayer.onLoadingChanged.

Looking at the hacky fast forward / rewind code I pushed a few minutes, as well as things like the radio info screens, I'd like to at some point refactor those behavious out of the main player class - but - thats future plans ;)

from android-tvheadend.

kiall avatar kiall commented on June 21, 2024 1

If you're still stuck, post the code to a PR and I'll see if I can spot anything on Tuesday (holidays until then!)

from android-tvheadend.

TheDiamondPicks avatar TheDiamondPicks commented on June 21, 2024

Awesome, thanks for that. I'll implement EDL support tonight.

from android-tvheadend.

TheDiamondPicks avatar TheDiamondPicks commented on June 21, 2024

I've come across bit of a stumbling block - the Target in #createMessage doesn't seem to get called for me. I suspect this is due to the same issue that means the current time is stuck on 0:00 (the duration seems to be fine). I don't know enough about ExoPlayer to try fixing this though.

from android-tvheadend.

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.