static void Main(string[] args) { //var client = new MegaStarzClient("http://*****:*****@"C:\1020.log", FileMode.Open, FileAccess.Read); } catch (Exception e) { } client.UploadRecordingAsync(response.Ticket.ticket, 1, fs, (recResponse) => { Console.WriteLine(recResponse.playUrl); }); }); // client.GetSongsAsync((response) => // { // foreach (var songResponse in response) // { // Console.WriteLine(string.Format("Song ({0}): \"{1}\", ({2}). Length {3}, PlayUrl: {4}", songResponse.id, songResponse.name, songResponse.artistName, songResponse.length, songResponse.playUrl)); // } // }); System.Threading.Thread.CurrentThread.Suspend(); }
private void OnFuncButtonClick(object sender, RoutedEventArgs e) { //case recording stop the recorde if (!startRecored) { funcBtn.Style = (Style)Resources["stopButton"]; startRecored = true; captureSource.Start(); var animation = (Storyboard)Resources["lyricsAnimation"]; animation.Begin(); } //case record stopped after recording else if(startRecored && (captureSource.State == CaptureState.Stopped)) { MessageBox.Show("Please wait while song is beign shared"); var client = new MegaStarzClient(); var t = ((App) (App.Current)).starTicket; var stream = FilesManager.GetFileStream("MegaStarz\\myVideo.mp4"); client.UploadRecordingAsync(t, 3, stream, (response) => { stream.Close(); stream.Dispose(); if (response != null) { Dispatcher.BeginInvoke(() => { MessageBox.Show ("Uploaded!"); }); } }); } //case the record didn't started yet else { funcBtn.Style = (Style)Resources["shareButton"]; captureSource.Stop(); var animation = (Storyboard)Resources["lyricsAnimation"]; animation.Stop(); } }