Welcome to Xamarin Guy Show Blog

Keep updated for latest and Greatest Posts from Xamarin guy

Xamarin Forms native WebTV

Live video broadcasting on Xamarin Forms

Hi Everyone in this blog we will integrate live broad cast tv inside Xamarin forms application.
You can watch the video for full configuration ◈ : https://youtu.be/YV8jPEl6eB0

At first we are going to get API Key and API Code from streamvideoproviders. -> www.streamingvideoprovider.com

Step 1 : This is the dashboard that you will be provided when you login with your social login or manual signup.

Step 2 : Click on Web TV -> Click on AddMedia.

Step3 : Select WebTV -> Give WebTV Details and Click on Create.

Additional Note : Web TV plays your playlist videos live 24×7. You can also select live stream and use OBS studio (mac) and play a live stream video directly to Xamarin Forms App.

Step 4: It’s time to get API credentials from streamingvideoprovider. Click on Settings> You will find API key and API Code on Right side. Don’t forget to click on save.

That’s all with streamingvideoprovider. We will be using API key and Code inside our Xamarin forms apps.

Xamarin Forms Blank APP video player integration ◈

Plugins to be installed on all projects: Plugin.MediaManager.Forms
1. https://github.com/Baseflow/XamarinMediaManager
Current Version to be installed : 0.9.5

Step 1 ◈ : So at first we will try to check video player working on stable condition or not for both android and iOS.

1. On Android
Call from MainActivity: CrossMediaManager.Current.Init(this);
2.On Other platforms
Call from AppDelegate, etc: CrossMediaManager.Current.Init();
3. Add this line of code on Xamarin Forms APP on any pages of XF.
[ <mm:VideoView VerticalOptions=”FillAndExpand” Source=”http://xamaringuyshow.com/wp-content/uploads/2019/01/microsoft2.3gpp” /> ]
This VideoView inherits from namespace :
xmlns:mm=”clr-namespace:MediaManager.Forms;assembly=MediaManager.Forms”

Note : If you are using http request on the Xamarin forms app. Then you have to enable App Transport Security on iOS and Http clear text on Android. 
iOS : https://docs.microsoft.com/en-us/xamarin/ios/app-fundamentals/ats 
Android : https://www.youtube.com/watch?v=wYd9x8elNQ8
That’s all 
Then you can run your 1st video on the Xamarin Forms Project for both android and iOS: 

Playing normal video on Android

Step 2 ◈ : Now it’s time to integrate the Platform independent code inside our XF .net shared project.

MainPage.xaml : You can provide height to video and optimise the screen as per your expectations.

MainPage.xaml.cs :

Step 3 ◈: Create folder-> Name it as Models.
This folder will contain classes which are required for parsing the xml response from API.

  1. ApiVideoResponse.cs

2. CommonVideoFetchResponse.cs :

3. Response.cs

That’s all final output :

Github Source Code : https://github.com/samirgcofficial/XFLiveWebTV/tree/master

 3,819 total views,  14 views today