Comments (6)
Also this check should be removed from didUpdateWidget
if (widget.url == null || widget.url.isEmpty) {
_disposePlatformView();
}
Because it will crash player when I just want to pause it:
_videoPlayer = VideoPlayout(
desiredState: PlayerState.STOPPED,
);
Want you do some PlayerController so we could control the video state without needing of recreate widget?
I will do PR when find all the errors.
from flutter_playout.
If we change the _onMediaChanged()
method in lib/video.dart
to following then this issue could be fixed.
void _onMediaChanged() {
if (widget.url != null) {
if (_methodChannel == null) {
_setupPlayer();
} else {
_methodChannel.invokeMethod("onMediaChanged", {
"autoPlay": widget.autoPlay,
"url": widget.url,
"title": widget.title,
"subtitle": widget.subtitle,
"isLiveStream": widget.isLiveStream,
});
}
}
}
I tested this by first passing null
as URL which resulted in a plan Container()
and then when I pass an actual URL and rebuild, it creates the player. Let me know your thoughts on this.
from flutter_playout.
Yes, it works if passing null, but will enter useless state if we supply some broken link to it:
Video _videoPlayer = Video(
url: "http://some_site.com/broken_link.mp4",
);
Native view will not be created because of the isPlayable
check but native channel will.
from flutter_playout.
That's true. The change you mentioned in #10 will fix this. Moving init code out of view()
in native iOS. Then media change can call init again if player was never initialised. Would it be possible for you to create a PR for this? Otherwise I'll try working on this later.
from flutter_playout.
Sorry, was working on another project.
I created PR with the changes you propose in _onMediaChanged()
and also in native part, because it crashes if I supply null url since last commit.
from flutter_playout.
Thanks for the PR. I've pushed a new version out which includes this. See v1.0.35
from flutter_playout.
Related Issues (20)
- Add multiple quality and bitrate selection
- Full screen feature
- Text Tracks not showing
- How can I get Duration of the video?
- Cannot touch controls
- iOS lock screen previous next buttons
- Question about iOS lock screen display
- 1
- A bug for Picture In Picture when back to home screen HOT 1
- Error playing video - Trying to create a platform view of unregistered type: tv.mta/NativeVideoPlayer - 2.0.2-rc1 HOT 6
- FAILURE: Build failed with an exception. HOT 1
- App Crash on Video Play. HOT 2
- Speed Controller
- deprecated HOT 1
- PIP not working
- flutter_playout/VideoPlayer.swift:159
- Can't play video in Android 12 playstore build.
- Cannot play audio HOT 1
- can not use this HOT 4
- Play media from user data resource
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 flutter_playout.