Hi Junian, thanks for the article. It's great. I'm having an issue and I wonder if you could help me. Once the Pagethat contains the video is loaded it takes a second to the Video to appear. It is there any way delay the Page loading so it is show only when the video is ready?Or perhaps a way to hide the page until is ready. Anyone has the same issue?
Hi Junian - Thanks for taking the time to write this post. It's people like you that help me get through any coding project
I attempted to implement your code and the creation of the texture view in the Android VideoRenderer throws an exception which I am not able to work out why. I replicated it in the github version of your code as well. I wrapped it in a try catch and I think the issue is
TextureView doesn't support displaying a background drawable
I managed to fix it by updating the implementation of the TextureView. I essentially replaced
var textureView = new TextureView(Context)
{
Background = new ColorDrawable(Xamarin.Forms.Color.Transparent.ToAndroid()),
Visibility = ViewStates.Gone,
LayoutParameters = new LayoutParams(
ViewGroup.LayoutParams.MatchParent,
ViewGroup.LayoutParams.MatchParent),
};
with
var textureView = new TextureView(Context);
By default, it seems to set the layout to full page... not sure what I am losing by doing this, but it works! If something pops up, Ill tweak it a bit more and report back
Thanks for this post! Great info and was able to use it to play local videos. Added a few more events to the custom renderers to handle stop, pause...etc. Awesome!
This feature is so cool and can make your app look more professional
You're kidding, right?
Try your full-screen video at high resolution when you're remoting into another system over a relatively slow network connection. Your "professional" app will spend its entire time redrawing the background and will be entirely unusable. In fact you just might end up trying to terminate your browser through a remote command line because the whole RDP session now can't keep up at all and you can't do anything with the entire computer.
The impression I get from these sites isn't that they're "professional", but that they're run by amateurs who got excited when they found something they hadn't seen before in a library and they apply it, without testing real-life scenarios, to situations where it's clearly not warranted and downright impractical.
Also - it's one thing to give the option to TURN THAT SH*T OFF, but it's another altogether if your app is too busy constantly rendering the video background over said slow connection, making it impossible to reach the option to turn it off.
This is a bad idea that should never have seen the light of day.
That said - I certainly wouldn't take anything away from the technical side of things - there's some interesting how-to stuff in there indeed--but I just feel rather strongly that a sample like this is just going to be misused and abused, and applied to cases where it clearly has potential to actually break things...
You must've missed the part where I said this is going to be misused and abused.
It might be fine for a phone or tablet, but the instant people start using this code on a device that can be remoted into, all bets are all.
Had you ever had to remotely reboot a machine (that you can't afford to reboot) because it's been rendered unusable by some dumb video playing in the background that you can't get rid of, you'd understand exactly why I get downright livid when I see this sort of thing being encouraged.
In fact you just might end up trying to terminate your browser through a remote command line because the whole RDP session now can't keep up at all and you can't do anything with the entire computer.
Browser? RDP session? Did you at least read the article what Xamarin is about? It's for mobile app, the video is stored locally. I say it looks more professional from User Interface aesthetic. A lot of apps already doing this, so far it's not a problem even for some old devices.
dandy72 wrote:
I just feel rather strongly that a sample like this is just going to be misused and abused
Every method can be misused and abused. Even a simple infinite loop once can make your browser unusable long time ago. So why skeptical on something new and practical?
If you have better solution, feel free to write back your own version.
Did you at least read the article what Xamarin is about?
Just because it's Xamarin doesn't mean somebody won't decide to take the source and adapt it back, say, to WPF.
Junian Triajianto wrote:
the video is stored locally.
How does that matter? It's not the download of the video that's the problem, it's the fact that the background is constantly changing that would cause an RDP session to spend all its time redrawing the screen.
Junian Triajianto wrote:
Every method can be misused and abused. Even a simple infinite loop once can make your browser unusable
Nobody sets out to write an article on how to write infinite loops as a "feature".
Junian Triajianto wrote:
If you have better solution, feel free to write back your own version.
Yes, my solution is called not implementing features that can cause problems. It takes no time at all to write, and doesn't need an article explaining it.
Look...I agree this is somewhat unique (until that sort of thing starts gaining in popularity), but the novelty quickly wears off, especially once you realize this brings nothing in terms of usefulness. In a world where we're being told UIs need to be kept clean and simple with lots of whitespace, having the entire background of an app turned into a video is a step back. And, as I keep saying, when a feature has the potential to require machines to be rebooted...I have a hard time telling everybody to add this to their app.
At the very least, a warning should be added to point out where this sort of thing can be a bad idea, or perhaps to mitigate the issue, the suggestion can be made to try to detect whether the current session is running inside RDP and if that's the case, don't play the video.
[Edit]
I'm not making this up - see this old message about DreamScene and RDP. At least this guy got lucky enough to keep control (somewhat) of the remote computer.
I don't mind seeing samples that potentially have pitfalls--I just feel it's the responsibility of the author to warn about scenarios where said samples might not be inappropriate. Otherwise you're just throwing things over the fence and hoping for the best. Have you seen some of the questions being posted in the Q&A section? Some people reading CP obviously can't make a good judgment call. Your article will be that much better if you make the effort to discuss potential problems.
Just post some caveats in your article, and I'm actually ready to vote it a 5.