Exemple #1
0
        public MainForm()
        {
            InitializeComponent();

            // put key for bass.net here if you have them (oterwhise you'll see a nag screen)
            mediaplayer = new Mediaplayer("", "");

            lbPlaylist.Items.Clear();
            lConnectStatus.Text = "";
            lFilename.Text      = "";
            bTogglePlay.Text    = "Play";
            tbLog.Text          = "";
            lPrevious.Text      = "";
            lNext.Text          = "";
            lPreBuf.Visible     = false;

            NewPlaylist();
            tbVolume.Value = mediaplayer.Volume;
            UpdateScreenPlaylist();

            mediaplayer.OnServerConnect    += new MP_OnServer(DoOnServerConnect);
            mediaplayer.OnServerDisconnect += new MP_OnServer(DoOnServerDisconnect);

            mediaplayer.OnStateChangeMediaplayer    += new MP_OnStateChangeMediaplayer(MP_OnStateChangeMediaplayer);
            mediaplayer.OnControleButtonStateChange += new MP_OnControleButtonStateChange(MP_OnControleButtonStateChange);

            mediaplayer.OnCurrentMediaItemChanged  += new PL_OnMediaItemChanged(DoOnCurrentMediaItemChanged);
            mediaplayer.OnPreviousMediaItemChanged += new PL_OnMediaItemChanged(DoOnPreviousMediaItemChanged);
            mediaplayer.OnNextMediaItemChanged     += new PL_OnMediaItemChanged(DoOnNextMediaItemChanged);

            mediaplayer.OnPlaylistStart += new MP_OnPlaylist(DoOnPlaylistStart);
            mediaplayer.OnPlaylistEnd   += new MP_OnPlaylist(DoOnPlaylistEnd);

            mediaplayer.OnMediaItemStartPlay += new MP_OnMediaItem(DoOnMediaItemStartPlay);
            mediaplayer.OnMediaItemEndPlay   += new MP_OnMediaItem(DoOnMediaItemEndPlay);
            mediaplayer.OnMediaItemSeekStart += new MP_OnMediaItem(DoOnMediaItemSeekStart);
            mediaplayer.OnMediaItemSeekEnd   += new MP_OnMediaItem(DoOnMediaItemSeekEnd);
            mediaplayer.OnPreBuffer          += new MP_OnPreBuffer(MP_OnPreBuffer);

            mediaplayer.OnTick += new MP_OnTick(DoOnTick);

            mediaplayer.TriggerMediaItemEvents();
            mediaplayer.TriggerButtonStateEvent();

            mediaplayer.RTMPServerLink = new ServerLink("rtmp://127.0.0.1:1935/vod");
            mediaplayer.Connect();
        }