I currently developing a Xamarin.form app that use .NetStandard as code sharing technique.
On a certain point in the app, the app must show a video from a url. A video could take up to 5 minutes.
I currently can't find a way how I can play a video in my Xamarin.Forms app.
Most of the examples on the web using PCL with .NET Framework.
I tried This plug in, but it isn't fully supported for .NetStandard, since it is written for .Net Framework:
https://github.com/martijn00/XamarinMediaManager
I already managed to play a video on Android and iOs following this tutorial:
https://blog.xamarin.com/delivering-rich-media-experiences-xamarin-forms-video-player/
However, it can only play videos up to 15 seconds for free and in UWP, it seems to be a bit broken.
I simply cannot figure out how I can play a video up to 5 minutes using .Net Standard.
Can someone please explain step by step how I can show a video in a Xamarin.Form app using .NetStandard as code sharing technique?
Or If anyone could explain in detail how to make my own video control, that works on each platform, that would be fantastic.
Your help is really much appreciated.
You may want to have a look at LibVLCSharp which provides a netstandard target as well as well native controls for each platforms.
Disclaimer: I am the maintainer.
You can find a full tutorial how implementing a video(local or web) in your app
manually at Xamarin documentation
either there is a sample
Related
Im trying to create an UWP App that allows the users to scan documents with TWAIN. I tried a few nugets such as Atalasoft DotTwain, NTwain, TwainDotNet and Saraff.Twain. All of them have samples made in WPF, Winforms... except the Saraff.Twain nuget that have a sample made in UWP.
The problem here is that when I run the WPF and Winforms samples all of them works pretty nice, basically is what I need to do but in UWP and when I try to use the code of the samples on my own App it doesn't build because it doesn't recognize a lot of classes even with the Using sentences at the start of my class.
The Saraff.Twain UWP sample doesn't build and i can't find another Twain UWP Sample on google.
Im not putting code because there is no particular problem but if you want it just leave a comment and I'll upload some.
Does anyone have used TWAIN in an UWP APP successfully? I'm very lost with it... Hope any of you have the key to the gate. Thanks.
UWP has its own document scanner API. In addition, it is possible to use Dynamic Web TWAIN in a UWP app. Check this blog: https://www.dynamsoft.com/codepool/uwp-document-scanning-web-twain.html
I'm developing an app in .Net Core 2.0 to run on a Raspberry Pi, which is running Win 10 IoT. The Pi has a USB WebCam attached and I'm looking to capture a still image from the camera. Unfortunately this is proving somewhat troublesome, to say the least.
Firstly I had a good search through the .Net Core 2.0 libraries to see if there's anything that will provide this functionality, but have not had any luck.
My second line of enquiry was NuGet, to see if any third-party libraries might do the job. EmguCV looked promising for a while, but they do not seem to support .Net Core just yet.
Finally I googled for anything that might do the job and came across the MediaCapture class in Windows.Media.Capture for UWP, but I've had no success referencing this from my .Net Core console app. It seems like you can reference .Net Core assemblies from UWP solutions, but I've not found a way to do it the other way around.
Bearing in mind that I'd prefer to keep my project in .Net Core 2.0, rather than re-writing for UWP, I'm looking for any means of capturing a still image from the WebCam. Any pointers will be gratefully received, as this is proving to be surprisingly frustrating.
For capturing images and other image processing activities, probably you can try OpenCvSharp.
It has support for .NET Core.
https://github.com/shimat/opencvsharp
NuGet Packages are available (look for more details in the above link on the correct one(s) to choose).
Here is an example for capturing video:
https://github.com/shimat/opencvsharp_samples/tree/master/CameraOpenCV
if you pass 0 (zero) as input to VideoCapture, it should open the default camera.
Something like this (not tried):
VideoCapture capture = new VideoCapture(0); //assumption based on how actual openCV works.
You can reference universal windows app's core libraries (Windows.Media.winmd, Windows.Security.winmd, etc...) on any dot net application (core, framework, standard). I have done it. However, the 'await' will be all messed up so you will have to deal with work around to use await and async (i.e. manually waiting for the task).
Windows.Media has the Microsoft's api to talk to the camera.
I am not sure if universal apps work on a Raspberry Pi thou.
Since you are using Win 10 IoT on Raspberry try using "Intelligent Kiosk" sample program available in Git by Microsoft. It gives a UWP app (Source Code) which has a good camera control with more options to customize. This is C#. If you want VB version you can ping me.
The IK code does many more things using Azure Cognitive services which may be of interest to you.
I am currently working on a solution where i want to livestream from my app. I succesfully get my camerastream working with avfoundation. The next step in order to complete my task is to send my video frames to a rtmp server but I am not sure on how i can accomplish this in xamarin forms ios.
For swift there is a library called https://github.com/jgh-/VideoCore that solves this but do we have something similiar in xamarin (any library) or documentation on examples that tackles this issue?
Thanks a lot!
Maybe it's a bit late for you, but this can probably help someone who wants to do the same thing (like I did), you can use the Xamarin port of LFLiveKit:
https://github.com/rhedgpeth/Xamarin-LFLiveKit
You'll have to implement a custom renderer to use it with forms, but it's not too hard if you follow the sample project in the repository.
I have a hobby project that I wrote in C#. Library is for geomatics calculations, it has over 4000 lines of code and I have spent years developing it. Recently I completed GUI using Windows Forms and shared it for free. I got good feedback and now I want to make it cross platform.
Problem is that after days of searching the Internet I found nothing. All links are outdated. I would prefer something like JavaFX, where I could possibly create one GUI for desktop and mobile without much hassle with compiling.
GTK# is stuck (no mobile and no integration for newer versions with Xamarin studio)
QtSharp is in Alpha stage
Eto.Forms for mobile is still under development
Are there any free working alternatives with good tutorials/documentation in late 2016? Or do I have to rewrite my libraries in Java and create GUI in JavaFX?
At the moment there isn't a .Net framework that support all platform. The solution that covers most platform is Xamarin (right now support Android, iOS and MS Universal App). As this post suggest probably in the near future there will a Xamarin version also for Linux systems.
But there is an alternative: duocode. Basically it's a tool that convert c# code into javascript and once is transformed you can use the javascript code to implement a mobile interface using a cross platform framework like cordova. You will have two different application but with the same code base.
I am trying to stream video from my webcam (audio and video) from .NET UWP IOT application.
I tried this WebCamApp sample from https://github.com/ms-iot/samples and it works perfectly. Now I would like to play with streaming that video to another PC/device. I am open to your suggestions on how to approach this. In past I was dealing with RTSP, but not on this platform. So far I saw that limitation is the .NET Core.
Are there any libraries for this? Or should i write something from scratch? What are your suggestions?
I don't have a complete solution, but what you're looking for is real time streaming. and I recommend using WebRTC.
WebRTC is a project built by google to support real time communication, you can play around with the sample from this website:
https://www.webrtc-experiment.com/
I found also this port for UWP, applications. But I'm not sure if it works with IOT:
https://www.nuget.org/packages/WebRTC/