com.loidd.JieCaoVideoPlayer 1.1.2

Video Player Control for Xamarin Android

Install-Package com.loidd.JieCaoVideoPlayer -Version 1.1.2
dotnet add package com.loidd.JieCaoVideoPlayer --version 1.1.2
<PackageReference Include="com.loidd.JieCaoVideoPlayer" Version="1.1.2" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add com.loidd.JieCaoVideoPlayer --version 1.1.2
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

<fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard
android:id="@+id/jc_video"
android:layout_width="match_parent"
android:layout_height="200dp" />

public class MainActivity : AppCompatActivity, IJCUserActionStandard
{
int count = 1;
private JCVideoPlayerStandard _mJcVideoPlayerStandard;

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        try
        {
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.main);

            _mJcVideoPlayerStandard = FindViewById<JCVideoPlayerStandard>(Resource.Id.jc_video);

            _mJcVideoPlayerStandard.ActivateLicense("LicenseKey"); // contact email to buy license key: vdev2210@gmail.com
            _mJcVideoPlayerStandard.SetUpPlayer("https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_30mb.mp4", JCVideoPlayer.ScreenLayoutNormal, "Video 1");

            Picasso.With(this)
                .Load("http://img4.jiecaojingxuan.com/2016/11/23/00b026e7-b830-4994-bc87-38f4033806a6.jpg@!640_360")
                .Into(_mJcVideoPlayerStandard.ThumbImageView);

            JCVideoPlayer.SetJcUserAction(this);
            // Get our button from the layout resource,
            // and attach an event to it
            //Button button = FindViewById<Button>(Resource.Id.MyButton);

            //button.Click += delegate { button.Text = $"{count++} clicks!"; };
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
    }

    public override void OnBackPressed()
    {
        if (JCVideoPlayer.BackPress()) return;
        base.OnBackPressed();
    }

    protected override void OnPause()
    {
        base.OnPause();
        JCVideoPlayer.ReleaseAllVideos();
    }

    public void OnEvent(int type, String url, int screen, params Object[] objects)
    {
        switch (type)
        {
            case JCUserAction.OnClickStartIcon:
                Console.WriteLine("ON_CLICK_START_ICON" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickStartError:
                Console.WriteLine("ON_CLICK_START_ERROR" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickStartAutoComplete:
                Console.WriteLine("ON_CLICK_START_AUTO_COMPLETE" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickPause:
                Console.WriteLine("ON_CLICK_PAUSE" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickResume:
                Console.WriteLine("ON_CLICK_RESUME" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnSeekPosition:
                Console.WriteLine("ON_SEEK_POSITION" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnAutoComplete:
                Console.WriteLine("ON_AUTO_COMPLETE" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnEnterFullscreen:
                Console.WriteLine("ON_ENTER_FULLSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnQuitFullscreen:
                Console.WriteLine("ON_QUIT_FULLSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnEnterTinyscreen:
                Console.WriteLine("ON_ENTER_TINYSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnQuitTinyscreen:
                Console.WriteLine("ON_QUIT_TINYSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnTouchScreenSeekVolume:
                Console.WriteLine("ON_TOUCH_SCREEN_SEEK_VOLUME" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnTouchScreenSeekPosition:
                Console.WriteLine("ON_TOUCH_SCREEN_SEEK_POSITION" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;

            case JCUserActionStandard.OnClickStartThumb:
                Console.WriteLine("ON_CLICK_START_THUMB" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserActionStandard.OnClickBlank:
                Console.WriteLine("ON_CLICK_BLANK" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            default:
                Console.WriteLine("unknow");
                break;
        }
    }
}

<fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard
android:id="@+id/jc_video"
android:layout_width="match_parent"
android:layout_height="200dp" />

public class MainActivity : AppCompatActivity, IJCUserActionStandard
{
int count = 1;
private JCVideoPlayerStandard _mJcVideoPlayerStandard;

    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);

        try
        {
            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.main);

            _mJcVideoPlayerStandard = FindViewById<JCVideoPlayerStandard>(Resource.Id.jc_video);

            _mJcVideoPlayerStandard.ActivateLicense("LicenseKey"); // contact email to buy license key: vdev2210@gmail.com
            _mJcVideoPlayerStandard.SetUpPlayer("https://www.sample-videos.com/video/mp4/720/big_buck_bunny_720p_30mb.mp4", JCVideoPlayer.ScreenLayoutNormal, "Video 1");

            Picasso.With(this)
                .Load("http://img4.jiecaojingxuan.com/2016/11/23/00b026e7-b830-4994-bc87-38f4033806a6.jpg@!640_360")
                .Into(_mJcVideoPlayerStandard.ThumbImageView);

            JCVideoPlayer.SetJcUserAction(this);
            // Get our button from the layout resource,
            // and attach an event to it
            //Button button = FindViewById<Button>(Resource.Id.MyButton);

            //button.Click += delegate { button.Text = $"{count++} clicks!"; };
        }
        catch (Exception e)
        {
            Console.WriteLine(e);
        }
    }

    public override void OnBackPressed()
    {
        if (JCVideoPlayer.BackPress()) return;
        base.OnBackPressed();
    }

    protected override void OnPause()
    {
        base.OnPause();
        JCVideoPlayer.ReleaseAllVideos();
    }

    public void OnEvent(int type, String url, int screen, params Object[] objects)
    {
        switch (type)
        {
            case JCUserAction.OnClickStartIcon:
                Console.WriteLine("ON_CLICK_START_ICON" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickStartError:
                Console.WriteLine("ON_CLICK_START_ERROR" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickStartAutoComplete:
                Console.WriteLine("ON_CLICK_START_AUTO_COMPLETE" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickPause:
                Console.WriteLine("ON_CLICK_PAUSE" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnClickResume:
                Console.WriteLine("ON_CLICK_RESUME" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnSeekPosition:
                Console.WriteLine("ON_SEEK_POSITION" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnAutoComplete:
                Console.WriteLine("ON_AUTO_COMPLETE" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnEnterFullscreen:
                Console.WriteLine("ON_ENTER_FULLSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnQuitFullscreen:
                Console.WriteLine("ON_QUIT_FULLSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnEnterTinyscreen:
                Console.WriteLine("ON_ENTER_TINYSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnQuitTinyscreen:
                Console.WriteLine("ON_QUIT_TINYSCREEN" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnTouchScreenSeekVolume:
                Console.WriteLine("ON_TOUCH_SCREEN_SEEK_VOLUME" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserAction.OnTouchScreenSeekPosition:
                Console.WriteLine("ON_TOUCH_SCREEN_SEEK_POSITION" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;

            case JCUserActionStandard.OnClickStartThumb:
                Console.WriteLine("ON_CLICK_START_THUMB" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            case JCUserActionStandard.OnClickBlank:
                Console.WriteLine("ON_CLICK_BLANK" + " title is : " + (objects.Length == 0 ? "" : objects[0]) + " url is : " + url + " screen is : " + screen);
                break;
            default:
                Console.WriteLine("unknow");
                break;
        }
    }
}

Release Notes

Require Xamarin.Android.Support.v7.AppCompat.25.3.1

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.1.2 408 6/30/2017