Giter Site home page Giter Site logo

Comments (26)

eneim avatar eneim commented on May 23, 2024 1

@langrenfengzi That's right, final release will have kind of many changes with RC5, so sorry for the inconvenient, but I would like to prevent future conflict with normal naming. For now, the spec is almost done (in me), I'm testing and reviewing to make sure everything works well.

from toro.

adventurist avatar adventurist commented on May 23, 2024 1

No problem. Hopefully I'll have more time to play with it tonight. If I learn anything, I will post updates here. Thanks!

from toro.

eneim avatar eneim commented on May 23, 2024 1

@adventurist You need to add corresponding repository. Please refer to README again, I have just updated it.

from toro.

adventurist avatar adventurist commented on May 23, 2024 1

Thank you! I have it added into my project and will now begin trying to develop a working implementation.

You have been very helpful, and I appreciate it.

from toro.

langrenfengzi avatar langrenfengzi commented on May 23, 2024

I had the same issue when I used the item layout of 'vh_toro_video_average_1.xml' in the demo.
I found 2 ToroVideoView. In the sample demo, it was im.ene.lab.toro.player.widget.ToroVideoView and used with the ExoPlayer. But when I used with the compile 'com.github.eneim:Toro:1.2.0', it became the im.ene.lab.toro.widget.ToroVideoView.

from toro.

eneim avatar eneim commented on May 23, 2024

Sorry for the late reply, the correct dependency definition for 2.0 is: im.ene.lab:toro. Let's try again with this. The current change log is the closest documentation right now, check it out too:

https://github.com/eneim/Toro/blob/develop/CHANGELOG.md

I'm working on the final draft, so stay tune.

from toro.

langrenfengzi avatar langrenfengzi commented on May 23, 2024

Thanks for replying.
In 2.0-RC5, I found the widget of playing the video was im.ene.lab.toro.player.widget.VideoPlayerView, and in the latest demo you renamed it to ToroVideoView again.

from toro.

adventurist avatar adventurist commented on May 23, 2024

I have updated my code to use 2.0.0-RC4, which has fixed the multidex issue, but now I have a new issue when trying to inflate the VideoPlayerView.

In my viewholder's layout resource I am using:

<im.ene.lab.toro.player.widget.VideoPlayerView android:id="@+id/video_view" android:layout_width="match_parent" android:layout_height="192dp" android:layout_centerInParent="true" android:layout_gravity="center" />

Inflating this from onCreateViewHolder causes:

                                                                         java.lang.NullPointerException: A valid VideoPlayerView is required.
                                                                             at im.ene.lab.toro.ext.ToroVideoViewHolder.<init>(ToroVideoViewHolder.java:40)
                                                                             at twitcher.twitcherurlconnect.StatusesAdapter$StVolder.<init>(StatusesAdapter.java:0)
                                                                             at twitcher.twitcherurlconnect.StatusesAdapter.onCreateViewHolder(StatusesAdapter.java:159)

My holder still extends the ToroVideoViewHolder class. Should this be different?

from toro.

eneim avatar eneim commented on May 23, 2024

Hm, I will investigate your issue carefully this weekend. Please wait a little bit more :D

from toro.

adventurist avatar adventurist commented on May 23, 2024

Would you recommend this file as a good ToroViewViewHolder example?

https://github.com/eneim/Toro/blob/release/v2.0.0-RC4/toro-sample/src/main/java/im/ene/lab/toro/sample/viewholder/SimpleToroVideoViewHolder.java

If so, may I ask a question about this code block:

@Override public void bind(Object item) { if (!(item instanceof SimpleVideoObject)) { throw new IllegalStateException("Unexpected object: " + item.toString()); }

mItem = (SimpleVideoObject) item;

mVideoView.setMedia(Uri.parse(mItem.video)); }

Where is mVideoView coming from? It doesn't seem to have been declared in the class, so I was assuming that this name had changed and that its value should be the same as that which is returned by the findVideoView() method. Assuming as much, I tried setting the videoplayerview to a class member and used findViewById inside the holder's constructor. I then set findVideoView to return that class member, but this still results in a null videoplayerview.

Will keep playing around with this..

from toro.

eneim avatar eneim commented on May 23, 2024

For short, the sample class extends this: > https://github.com/eneim/Toro/blob/develop/toro-ext/src/main/java/im/ene/lab/toro/ext/ToroVideoViewHolder.java

So hope you got the idea. I will take further look later today (i'm at GMT +9:00).

from toro.

eneim avatar eneim commented on May 23, 2024

Please refer the latest master branch though.

from toro.

adventurist avatar adventurist commented on May 23, 2024

Strangely enough, though I tried basing my viewholder off of that example, the following always returns null in spite of accurately referencing the view in my layout file:

(im.ene.lab.toro.player.widget.VideoPlayerView) mView.findViewById(R.id.video_view);

from toro.

eneim avatar eneim commented on May 23, 2024

@adventurist Did you remove old dependency from your gradle.build? the com.github.eneim one. Just use only one dependency.

from toro.

adventurist avatar adventurist commented on May 23, 2024

That worked, findViewById no longer returns null. Thank you.

I am still a bit confused about the implementation. Am I correct in understanding that videos play when scrolled to? Do I still need to implement a player or set the viewholder's "isPlayable" to "true"? I have been trying to do that, but it remains false. Any tips on troubleshooting?

from toro.

eneim avatar eneim commented on May 23, 2024

@adventurist Good to hear that. That's my bad actually. I think I will update some new on current 2.0 soon. But for now, this is the least you need to do to make it works. At first time opening the list, it may not work due to another issue, so just scroll a bit to see the effect :(. I'm fixing that issue now ... Basically current sample source code is working pretty well, please take a look.

from toro.

adventurist avatar adventurist commented on May 23, 2024

Thanks a lot for the direction! I have switched to trying to use an implementation similar to that of Basic1VideoViewHolder. I have been using the 2.0.0-RC4 version of your library. In the development repo, I see that ToroPlayer has the following method:

    @Override public void onPlaybackCompleted() {
        this.isPlayable = false;
    }

Is there an equivalent class to override in the 2.0.0-RC4 library?

from toro.

eneim avatar eneim commented on May 23, 2024

@adventurist I think it is safe to use it now. I don't want to provide more methods to prevent the 65K issue. I think it will make more sense to use something provided by ExoPlayer, but since I need to keep track of the ViewHolder's life-cycle, it is a bit more complicated. Right now controlling the playability is set to second highest priority in my list after the Activity Lifecycle issue, please wait a bit more.

from toro.

adventurist avatar adventurist commented on May 23, 2024

@eneim Okay! I was going to try and work from the develop branch. May I ask for the correct method of importing it?

ext {
    toro_latest_version = 'develop';
}

from toro.

eneim avatar eneim commented on May 23, 2024

@adventurist Sorry for the late reply. I have push latest snapshot to sonatype, you can use it by as follow:

// Choose the suitable one
compile "im.ene.lab:toro:2.0.0-SNAPSHOT"
compile "im.ene.lab:toro-player:2.0.0-SNAPSHOT"
compile "im.ene.lab:toro-ext:2.0.0-SNAPSHOT"

from toro.

adventurist avatar adventurist commented on May 23, 2024

Hello! No problem.

I tried adding im.ene.lab:toro:2.0.0-SNAPSHOT to my gradle dependencies. Here's the error message I'm getting:

Error:Failed to resolve: im.ene.lab:toro:2.0.0-SNAPSHOT

from toro.

adventurist avatar adventurist commented on May 23, 2024

Does 2.0.0-SNAPSHOT's ToroVideoViewHolder use something in place of "bind" to set the media URL on a ToroVideoView?

from toro.

eneim avatar eneim commented on May 23, 2024

@adventurist It's safe to call setMedia from bind method of ToroVideoViewHolder. You should to that actually.

from toro.

adventurist avatar adventurist commented on May 23, 2024

Ah yes, I was hoping to do that. Have the method parameters changed? I can't seem to override the superclass when extending ToroVideoViewHolder.

In 2.0.0-RC4 I was using:

@Override public void bind(@Nullable Object object)  {
    Log.d("STAdapt", "attempting to bind");
    if (object != null && object instanceof StatusItem)  {
        Log.d("STAdapt", "Setting media");
        twitVideo.setMedia(Uri.parse(((StatusItem) object).getVideo()));
    }
}

In SNAPSHOT, however, it doesn't override.

Also, is there a way of cloning the files from Sonatype, so I can use grep to search through the parent classes?

Sorry for all the questions :)

from toro.

adventurist avatar adventurist commented on May 23, 2024

Ahh, yes, answer for above: It just needed to be passed a RecyclerView.Adapter

from toro.

adventurist avatar adventurist commented on May 23, 2024

Should have closed this 7 years ago :)

from toro.

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.