public ActionResult List(DateTime bDate, DateTime eDate, string SearchType = "", int MinistryID = 0, string code = "", int codeID2 = 0, string CallerType = "") { ViewBag.CallerType = CallerType; IEnumerable <video> VideoList; if (SearchType == "MinistrySearch") { VideoList = VideoRepository.GetVideoByMinistry(MinistryID, bDate.Date, eDate.Date); } else if (SearchType == "MinistryStatusSearch") { VideoList = VideoRepository.GetVideoByMinistryStatus(MinistryID, code); } else if (SearchType == "StatusSearch") { VideoList = VideoRepository.GetVideoByStatus(code); } else { VideoList = VideoRepository.GetVideoByDateRange(bDate.Date, eDate.Date); } ViewBag.RecordCount = VideoList.Count(); return(PartialView(VideoList)); }
private void FileNameLoad(string filePath) { DirectoryInfo directoryInfo = new DirectoryInfo(filePath); List <ListViewItem> videoDeleteList = new List <ListViewItem>(); List <ListViewItem> subtitleDeletList = new List <ListViewItem>(); VideoList.FileNameLoad(directoryInfo); SubtitleList.FileNameLoad(directoryInfo); foreach (ListViewItem videoname in VideoList.fileNameListView.Items) { foreach (ListViewItem subtitlename in SubtitleList.fileNameListView.Items) { if (videoname.ToString() == subtitlename.ToString()) { videoDeleteList.Add(videoname); subtitleDeletList.Add(subtitlename); } } } foreach (var item in videoDeleteList) { VideoList.fileNameListView.Items.Remove(item); } foreach (var item in subtitleDeletList) { SubtitleList.fileNameListView.Items.Remove(item); } }
public DeleteButtonCommand(InkCollector inkcollector, MyButton myButton, VideoList videoList) { _inkcollector = inkcollector; _sketch = _inkcollector.Sketch; _myButton = myButton; _videoList = videoList; }
//VideoViewから public void Remove(VideoViewModel vm) { if (VideoList.Contains(vm)) { VideoList.Remove(vm); } }
/// <summary> /// Return all the Music videos for a known Music_Brainz_ID /// </summary> /// <param name="mbid">Music_Brainz_Artist_ID</param> /// <param name="apiKey">ApiKey</param> /// <returns></returns> public static VideoList Video(Guid mbid, string apiKey = "") { var ret = new VideoList(); if (apiKey == "") { apiKey = Settings.TheAudioDb.ApiKey; } var le = new LogEntry("Sites.TheAudioDB", "Search", "Video"); le.Parameters.Add(new Para("mbid", mbid.ToString())); le.Parameters.Add(new Para("apiKey", apiKey)); Logging.NewLogEntry(le); try { ret.Data = Json.Deserialize <VideoListResult>(Http.Request("http://www.theaudiodb.com/api/v1/json/" + apiKey + "/mvid-mb.php?i=" + mbid)) ?? new VideoListResult(); } catch (Exception ex) { Exceptions.NewException(ex); } return(new VideoList(ret.Data)); }
private void PlayVideoFromList(VideoList videoList) { if (videoList == null) { return; } var video = videoList.Videos[UnityEngine.Random.Range(0, videoList.Videos.Count)]; var videoChromaKey = _videos.Find(v => v.VideoClip == video); if (videoChromaKey == null) { return; } var currentPlayer = _videoPlayers[_currentPlayer]; currentPlayer.PlayVideoDelay(videoChromaKey, videoList.TimeDelay); for (int i = 0; i < _videoPlayers.Count; i++) { var locPos = _videoPlayers[i].RectTransform.localPosition; _videoPlayers[i].RectTransform.localPosition = new Vector3(locPos.x, locPos.y, _videoPlayers.Count - i); } _currentPlayer = (_currentPlayer + 1) % _videoPlayers.Count; }
/// <summary> /// Return a Music DVD from artist/mdvd name /// </summary> /// <param name="artistName">Artist</param> /// <param name="dvdName">Music_Dvd_Name</param> /// <param name="apiKey">ApiKey</param> /// <returns></returns> public static VideoList Video(string artistName, string dvdName, string apiKey = "") { var ret = new VideoList(); if (apiKey == "") { apiKey = Settings.TheAudioDb.ApiKey; } var le = new LogEntry("Sites.TheAudioDB", "Search", "Video"); le.Parameters.Add(new Para("artistName", artistName)); le.Parameters.Add(new Para("dvdName", dvdName)); le.Parameters.Add(new Para("apiKey", apiKey)); Logging.NewLogEntry(le); try { ret.Data = Json.Deserialize <VideoListResult>(Http.Request("http://www.theaudiodb.com/api/v1/json/" + apiKey + "/searchmdvd.php?s=" + artistName + "&a=" + dvdName)) ?? new VideoListResult(); } catch (Exception ex) { Exceptions.NewException(ex); } return(new VideoList(ret.Data)); }
public async Task <IActionResult> MakePayment([FromBody] Transaction transaction, string ip, int pid) { var json = JsonConvert.SerializeObject(transaction); var uri = "http://localhost:61820/transactions/new"; var stringContent = new StringContent(json, System.Text.Encoding.UTF8, "application/json"); var client = new HttpClient(); client.DefaultRequestHeaders.Accept.Add(new System.Net.Http.Headers.MediaTypeWithQualityHeaderValue("application/json")); var response = await client.PostAsync(uri, stringContent); var content = await response.Content.ReadAsStringAsync(); var rsp = new { message = "" }; var data = JsonConvert.DeserializeAnonymousType(content, rsp); if (data.message.Contains("Transaction will be added to Block") && ip != null) { //successfull and unlock the video await this.HubContext.Clients.All.SendAsync( ip, pid, VideoList.Videos().First(x => x.Id == pid).Url); VideoOwned.AddUser(ip, pid); } return(Ok(data)); }
public VideoList Get() { var videoList = new VideoList(); var connString = SqlDatabase.GetConnectionString(); var conn = new SqlConnection(connString); using (var cmd = conn.CreateCommand()) { cmd.CommandText = "SELECT [Id], [Title], [Key] FROM Videos"; conn.Open(); using (var reader = cmd.ExecuteReader(CommandBehavior.CloseConnection)) { while (reader.Read()) { var temp = new Video { Id = reader.GetInt32(0), Title = reader.GetString(1), Key = reader.GetString(2) }; videoList.Add(temp); } } } return(videoList); }
public async Task <IActionResult> Edit(int id, [Bind("VideoId,name,VideoField")] VideoList videoList) { if (id != videoList.VideoId) { return(NotFound()); } if (ModelState.IsValid) { try { _context.Update(videoList); await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!VideoListExists(videoList.VideoId)) { return(NotFound()); } else { throw; } } return(RedirectToAction(nameof(Index))); } return(View(videoList)); }
async Task <VideoList> getYoutube() { // var url = "http://www.youtube.com/playlist?list=UUy2j4l0auN8DJaQ6itwVWFA"; // var url = "http://www.youtube.com/watch?v="; // タイトル一覧を取得する var youtube = new YouTubeService(new Google.Apis.Services.BaseClientService.Initializer() { ApiKey = "", // Google API key ApplicationName = "VS100Watcher" }); var videos = new VideoList(); var req = youtube.Search.List("snippet"); req.ChannelId = "UCy2j4l0auN8DJaQ6itwVWFA"; // "VisualStudioJapan" のチャンネルID var res = new Google.Apis.YouTube.v3.Data.SearchListResponse(); do { req.PageToken = res.NextPageToken; res = await req.ExecuteAsync(); // Youtube のサムネールをリスト化する foreach (var it in res.Items) { var vi = new Video() { Result = it }; // var cl = new HttpClient(); // var data = await cl.GetByteArrayAsync(vi.ThumUrl); // var bmp = new BitmapImage(); // var mem = new MemoryStream(data); // await bmp.SetSourceAsync( mem.AsRandomAccessStream() ); // vi.ThumImage = bmp; videos.Add(vi); } } while (res.NextPageToken != null && res.NextPageToken != ""); // 番号でソートする var lst = new VideoList(); foreach (var it in videos.OrderBy(x => { if (x.Title.StartsWith("VS100")) { return(x.Title.Replace(" ", "").Replace("-", "")); } else { return(x.Title); } })) { lst.Add(it); Debug.WriteLine(it.Title); } return(lst); }
/// <summary> /// 打开窗口 /// </summary> private void ExecuteOpenVSCmd() { DetectFileChooseWindow sender = new DetectFileChooseWindow(); Messenger.Default.Send(VideoList.Count, "DVM2VVM"); VideoList.Clear();//每次打开视频选择窗口时,将已选择的视频列表删除,防止重复添加 sender.Show(); }
public async Task <IActionResult> ApiCall(string ip, int id) { await this.HubContext.Clients.All.SendAsync(ip, id, VideoList.Videos().First(x => x.Id == Convert.ToInt32(id)).Url); VideoOwned.AddUser(ip, id); return(Content("successfull")); }
public IActionResult Index() { var videoList = VideoList.Videos(); ViewBag.Videos = videoList; return(View()); }
public async Task GetVideosAsync_ValidId_ReturnsValidResult(int id) { IMovieApi apiUnderTest = new MovieApi(_clientWithNoApiKey); VideoList result = await apiUnderTest.GetVideosAsync(id, _userApiKey); Assert.IsNotNull(result); Assert.AreEqual(id, result.Id); }
public async Task GetSeasonVideosAsync_ValidId_ReturnsValidResult(int tvId, int seasonNumber) { ITelevisionApi apiUnderTest = new TelevisionApi(_clientWithNoApiKey); VideoList result = await apiUnderTest.GetSeasonVideosAsync(tvId, seasonNumber, apiKey : _userApiKey); Assert.IsNotNull(result); Assert.IsNotEmpty(result.Results); }
public async Task GetVideosAsync_ValidId_ReturnsValidResult(string id) { ITelevisionApi apiUnderTest = new TelevisionApi(_clientWithNoApiKey); VideoList result = await apiUnderTest.GetVideosAsync(id, apiKey : _userApiKey); Assert.IsNotNull(result); Assert.AreEqual(id, result.Id.ToString()); }
private void ScrollToFirstHighlightedIfAny() { if (_currentFocused.HasValue && _currentFocused.Value >= 0 && _currentFocused.Value < _highlightedItems.Count) { var lbi = _highlightedItems[_currentFocused.Value]; var obj = lbi.DataContext; VideoList.ScrollIntoView(obj); lbi.IsSelected = true; } }
public override bool Equals(object obj) { VideoList list = obj as VideoList; if (list == null) { return(false); } return(this.ListID == list.ListID && this.Name == list.Name); }
public ActionResult Index(string video) { VideoList vl = new VideoList { Parents = new List <Models.File>(), Videos = new List <Models.File>() }; string[] parents = Directory.GetDirectories(@Server.MapPath("~/Content/Training Videos")); string firstvideo = ""; for (int i = 0; i < parents.Length; i++) { Models.File p = new Models.File { Path = parents[i], Name = parents[i].Split('\\')[parents[i].Split('\\').Length - 1], Parent = "" }; vl.Parents.Add(p); string[] files = Directory.GetFiles(parents[i]); for (int j = 0; j < files.Length; j++) { if (i == 0 && j == 0) { firstvideo = files[j]; } Models.File f = new Models.File { Path = files[j], Name = files[j].Split('\\')[files[j].Split('\\').Length - 1], Parent = p.Name }; vl.Videos.Add(f); } } MainPageModel model = new MainPageModel(); model.VideoList = vl; model.Video = new Models.File(); if (string.IsNullOrEmpty(video)) { model.Video.Path = firstvideo; } else { model.Video.Path = video; } string[] temp = model.Video.Path.Split('\\'); model.Video.Name = temp[temp.Length - 1]; model.Video.Parent = temp[temp.Length - 2]; model.VideoTitle = model.Video.Parent + " - " + model.Video.Name.Replace(".mp4", ""); return(View(model)); }
protected async override void OnCreate(Bundle bundle) { base.OnCreate(bundle); CurrentPlatform.Init(); //List to hold results of following add operations List <Task> results = new List <Task>(); // Adding Users var users = new UserList(); var tableUser = AzureDataService.Client.GetTable <User>(); users.ForEach(u => { results.Add( tableUser.InsertAsync(u) ); }); // Adding videos var videos = new VideoList(); var tableVideo = AzureDataService.Client.GetTable <Video>(); videos.ForEach(v => { results.Add( tableVideo.InsertAsync(v) ); }); // Adding units var units = new UnitList(); var tableUnits = AzureDataService.Client.GetTable <Unit>(); units.ForEach(u => { results.Add( tableUnits.InsertAsync(u) ); }); // Adding Units for Users. Just going to populate table with data for now. TODO: User object should contain units. Store data properly on backend var userUnitList = new UserUnitList(); var tableUnitList = AzureDataService.Client.GetTable <UserUnit>(); userUnitList.ForEach(u => { results.Add( tableUnitList.InsertAsync(u) ); }); RefreshUI(results); //ThreadPool.QueueUserWorkItem(o => DownloadVideo()); }
public async Task <IActionResult> Create([Bind("VideoId,name,VideoField")] VideoList videoList) { if (ModelState.IsValid) { _context.Add(videoList); await _context.SaveChangesAsync(); return(RedirectToAction(nameof(Index))); } return(View(videoList)); }
// // GET: /Admin/Video/ public ActionResult Approval() { Breadcrumbs.Current.AddBreadcrumb(2, "Video Approval"); Util.SetReturnPage(2); //var dataList = VideoList.LoadByStatus("New"); Sql sql = new Sql("SELECT video.* FROM Video where 1=1"); sql.Add("and status =", "New".Sqlize_Text()); var dataList = VideoList.Load(sql); return(View("VideoApproval", dataList)); }
private async void LoadData() { HttpClient client = new HttpClient(); var json = await client.GetStringAsync(new Uri("http://localhost:5000/api/Media/movies")); var movielist = JsonConvert.DeserializeObject <IList <Movie> >(json); foreach (var movie in movielist) { VideoList.Add(movie); } FillCategoryListVideoList(); }
public void CreateVideo(string name, string genre) { var tempVideo = new Video() { id = availableID, name = name, genre = genre }; availableID++; VideoList.Add(tempVideo); }
public async Task <bool> GetListVideoOnChanel(string ChanelName, CancellationToken token) { if (token.IsCancellationRequested) { throw new OperationCanceledException(); } List <YoutubeVideo> listVideo; try { //----- get all list video on channel-----------// listVideo = await youtubeManager.GetListVideos(ChanelName, token); if (token.IsCancellationRequested) { throw new OperationCanceledException(); } await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { try { //-------remove video on list-----------// for (int i = VideoList.Count - 1; i >= 0; i--) { VideoList.RemoveAt(i); } //--- add list video-----// for (int i = 0; i < listVideo.Count; i++) { VideoList.Add(listVideo[i]); } } catch (Exception ex) { throw new OperationCanceledException(); } } ); } catch (Exception ex) { throw new OperationCanceledException(); } return(true); }
/// <summary> /// 展示选择检测列表数量 /// </summary> /// <param name="obj"></param> private void ShowReceiveInfo(ObservableCollection <MetaViewModel> obj) { if (obj.Count == 0) { ReceiveStr = "您还未选择文件"; } else { ReceiveStr = "共选择了" + obj.Count + "个文件"; foreach (var item in obj) { VideoList.Add(item); } } }
public static VideoList AllVideoInfo() { VideoList allVideoInfo = new VideoList(); List <string> videoIds = new List <string>(); List <string> videoTitles = new List <string>(); List <string> videoDates = new List <string>(); List <string> videoUsers = new List <string>(); MySqlConnection connection = new MySqlConnection(); connection.ConnectionString = ConfigurationManager.ConnectionStrings["MySQLConnection"].ConnectionString; try { connection.Open(); MySqlCommand cmd = new MySqlCommand("SELECT id, title, date, user FROM videos", connection); MySqlDataReader rdr = cmd.ExecuteReader(); while (rdr.Read()) { videoIds.Add(rdr.GetString(0)); videoTitles.Add(rdr.GetString(1)); videoDates.Add(GetDate(rdr.GetString(2))); videoUsers.Add(rdr.GetString(3)); } allVideoInfo.Ids = videoIds; allVideoInfo.Titles = videoTitles; allVideoInfo.Dates = videoDates; allVideoInfo.Users = videoUsers; return(allVideoInfo); } catch (MySqlException ex) { System.Diagnostics.Debug.WriteLine("DatabaseOps - > VideoList() Error:" + ex.Message); return(allVideoInfo); } finally { if (connection != null) { connection.Close(); } } }
public void Load(SearchResult SearchInfo) { this.SearchInfo = SearchInfo; foreach (Album item in SearchInfo.Albums) { AlbumList.Add(new SearchItem(item.Title, item.Artists[0].Name, TimeHelper.ConverIntToString(item.Duration))); } foreach (Track item in SearchInfo.Tracks) { TrackList.Add(new SearchItem(item.Title, item.Artists[0].Name, TimeHelper.ConverIntToString(item.Duration))); } foreach (Video item in SearchInfo.Videos) { VideoList.Add(new SearchItem(item.Title, item.Artists[0].Name, TimeHelper.ConverIntToString(item.Duration))); } }
void InitializeMediaPlayer() { m_hasSetMediaSource = false; if (CurrentEffect == null || CurrentVideo == null) { return; } // Initialize Transition SecondVideo = VideoList.IndexOf(CurrentVideo) == VideoList.Count - 1 ? VideoList[0] : VideoList[VideoList.IndexOf(CurrentVideo) + 1]; ThirdVideo = VideoList.IndexOf(SecondVideo) == VideoList.Count - 1 ? VideoList[0] : VideoList[VideoList.IndexOf(SecondVideo) + 1]; advanced_media_source.ResetTimeline(); advanced_media_source.AddVideo(CurrentVideo); advanced_media_source.AddTransitionEffect(CurrentEffect.EffectType, 1); advanced_media_source.AddVideo(SecondVideo); advanced_media_source.AddTransitionEffect(CurrentEffect.EffectType, 1); advanced_media_source.AddVideo(ThirdVideo); // Initialize MediaStreamSource VideoEncodingProperties videoProperties = VideoEncodingProperties.CreateUncompressed(MediaEncodingSubtypes.Bgra8, c_frameWidth, c_frameHeight); videoDesc = new VideoStreamDescriptor(videoProperties); videoDesc.EncodingProperties.FrameRate.Numerator = c_frameRateN; videoDesc.EncodingProperties.FrameRate.Denominator = c_frameRateD; videoDesc.EncodingProperties.Bitrate = (uint)(c_frameRateN * c_frameRateD * c_frameWidth * c_frameHeight * 4); AudioEncodingProperties audioProperties = AudioEncodingProperties.CreatePcm(c_sampleRate, c_channelCount, c_bitsPerSample); audioDesc = new AudioStreamDescriptor(audioProperties); media_stream_source = new Windows.Media.Core.MediaStreamSource(videoDesc, audioDesc); TimeSpan spanBuffer = new TimeSpan(0, 0, 0, 0, 0); media_stream_source.BufferTime = spanBuffer; media_stream_source.Starting += MSS_Starting; media_stream_source.Closed += MSS_Closed; media_stream_source.SampleRequested += MSS_SampleRequested; Video.SetMediaStreamSource(media_stream_source); m_hasSetMediaSource = true; }