コード例 #1
0
        private async void playButton_Click(object sender, RoutedEventArgs e)
        {
            // Get URI
            if (player != null)
            {
                player.Close();
                player = null;
            }
            Uri uri;

            try
            {
                uri = new Uri(sourceUrl.Text);
            }
            catch
            {
                rootPage.NotifyUser("Invalid URL given", NotifyType.ErrorMessage);
                return;
            }

            haveSetSource = true;
            player        = new LiveDash.LiveDashPlayer();

            if (haveSetLiveOffset)
            {
                player.DesiredLiveOffset(liveOffset);
            }

            await player.Initialize(uri, mediaElement);

            // Clear the status block when you press play
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
        }
コード例 #2
0
 private void gotToLiveButton_Click(object sender, RoutedEventArgs e)
 {
     if (haveSetSource)
     {
         if (haveSetLiveOffset)
         {
             player.DesiredLiveOffset(liveOffset);
         }
         player.GoToLive();
         rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);
     }
     else
     {
         rootPage.NotifyUser("You must set the source first before going to live", NotifyType.ErrorMessage);
     }
 }
コード例 #3
0
        private async void playButton_Click(object sender, RoutedEventArgs e)
        {
            // Get URI
            if (player != null)
            {
                player.Close();
                player = null;
            }
            Uri uri;
            try
            {
                uri = new Uri(sourceUrl.Text);
            }
            catch
            {
                rootPage.NotifyUser("Invalid URL given", NotifyType.ErrorMessage);
                return;
            }

            haveSetSource = true;
            player = new LiveDash.LiveDashPlayer();

            if (haveSetLiveOffset)
            {
                player.DesiredLiveOffset(liveOffset);
            }

            await player.Initialize(uri, mediaElement);

            // Clear the status block when you press play
            rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage);

        }