Comments (26)
@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.
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.
@adventurist You need to add corresponding repository. Please refer to README again, I have just updated it.
from toro.
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.
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.
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:
I'm working on the final draft, so stay tune.
from toro.
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.
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.
Hm, I will investigate your issue carefully this weekend. Please wait a little bit more :D
from toro.
Would you recommend this file as a good ToroViewViewHolder example?
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.
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.
Please refer the latest master branch though.
from toro.
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.
@adventurist Did you remove old dependency from your gradle.build? the com.github.eneim
one. Just use only one dependency.
from toro.
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.
@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.
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.
@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.
@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.
@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.
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.
Does 2.0.0-SNAPSHOT's ToroVideoViewHolder use something in place of "bind" to set the media URL on a ToroVideoView?
from toro.
@adventurist It's safe to call setMedia
from bind method of ToroVideoViewHolder. You should to that actually.
from toro.
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.
Ahh, yes, answer for above: It just needed to be passed a RecyclerView.Adapter
from toro.
Should have closed this 7 years ago :)
from toro.
Related Issues (20)
- [Feature Request] Make Player attached to lifecycle HOT 2
- how to set player for a specific position in a container HOT 1
- Initialize() in VideoViewHolder is not getting called.
- Videos Start Playing onScroll even after pausing it manually in Container. HOT 3
- Loop video HOT 1
- Using Toro + ExoPlayer in Dynamic Feature Module HOT 1
- Pre-caching/Downloading progressive streams in ExoPlayer HOT 1
- App is crashing with the following error
- App is crashing with the following error HOT 5
- How to use ToroExoplayer inside view pager which is inside a container? HOT 1
- Custom MediaSource
- Hi,
- Video was playing continously in background even after opening bottom sheet
- Audio is playing but video shows black screen HOT 1
- [Bug report] Hls videos always picks the Highest quality stream intially HOT 5
- [Bug report] Crashed app com.google.android.exoplayer2.trackselection.DefaultTrackSelector HOT 2
- Wiki update
- Getting errors when running the project. HOT 10
- com.google.android.exoplayer2.video.VideoListener was removed in ExoPlayer 2.16.0, making this library incompatible HOT 2
- How to autoplay video viewpager (contain image/video) inside recyclerview
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from toro.