Example #1
0
    private void SetButtonOnclick(Button button, int i)
    {
        button.onClick.AddListener(() => {
            if (VideoButton[i].transform.GetChild(0).GetComponent <Text>().color == blue)
            {
                return;
            }

            ResetVideoButtonSprite();
            VideoButton[i].gameObject.GetComponent <Image>().sprite          = Video_Sprite_click[i];
            VideoButton[i].transform.GetChild(0).GetComponent <Text>().color = blue;

            VideoControl_TiltleText.text = VideoButton[i].transform.GetChild(0).GetComponent <Text>().text;
            VideControl_TipImage.sprite  = Video_Sprite_NotClick[i];

            VideControl_Mask.gameObject.SetActive(false);

            CurrentVideoLenth = VideoLenth[1];

            VideoName panelName = (VideoName)Enum.Parse(typeof(VideoName), (i + 1).ToString());
            Display_PlayVideo display_PlayVideo = new Display_PlayVideo();
            display_PlayVideo.name = panelName.ToString();
            UdpSclient.Instance.SendDataToSever(ParmaterCodes.Display_PlayVideo, display_PlayVideo);
            SetSlider(CurrentVideoLenth);
            IsPlay = true;
        });
    }
Example #2
0
        public static void play(VideoName name)
        {
            if (!IsPlaying && !GameLoop.gameInstance.parameterNoVideo)
            {  //Julius: enum für jedes verfügbare video anpassen!
                switch (name)
                {
                /*Julius: BEISPIEL:
                 *"Testvideo" ist in diesem Beispiel der interne assetName (wie oben vergeben)
                 */
                //Container["Testvideo"].play();
                //currentlyPlaying = "Testvideo";

                case VideoName.None:
                    return;

                case VideoName.Cutscene_1:
                    Container["Cutscene 1"].play();
                    currentlyPlaying = "Cutscene 1";
                    GameStateManager.Default.currentGameState = GameState.PlayingCutscene;
                    break;

                case VideoName.Cutscene_2:
                    Container["Cutscene 2"].play();
                    currentlyPlaying = "Cutscene 2";
                    GameStateManager.Default.currentGameState = GameState.PlayingCutscene;
                    break;
                }
            }
        }
Example #3
0
 /// <summary>Snippet for GetVideo</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetVideoResourceNames()
 {
     // Create client
     VideoServiceClient videoServiceClient = VideoServiceClient.Create();
     // Initialize request argument(s)
     VideoName resourceName = VideoName.FromCustomerVideo("[CUSTOMER_ID]", "[VIDEO_ID]");
     // Make the request
     Video response = videoServiceClient.GetVideo(resourceName);
 }
Example #4
0
        /// <summary>Snippet for GetVideoAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetVideoResourceNamesAsync()
        {
            // Create client
            VideoServiceClient videoServiceClient = await VideoServiceClient.CreateAsync();

            // Initialize request argument(s)
            VideoName resourceName = VideoName.FromCustomerVideo("[CUSTOMER]", "[VIDEO]");
            // Make the request
            Video response = await videoServiceClient.GetVideoAsync(resourceName);
        }
Example #5
0
        public string GrabPictureData(string saveFileName, bool needSave = true)
        {
            if (!IsPlayStarted())
            {
                return("");
            }

            try
            {
                Image img = ocx_VodSdk_GrabPictureData();

                if (img == null)
                {
                    DevComponents.DotNetBar.MessageBoxEx.Show("抓图失败", Framework.Environment.PROGRAM_NAME);
                    return("");
                }
                string time     = DateTime.Now.ToString("yyyyMMddHHmmssfff");
                string type     = "视频截图";
                string fileName = VideoName.Replace(".", "_").Replace(":", "_") + type + time + ".jpg";

                //fileName = Framework.Environment.PictureSavePath.TrimEnd('\\') + "\\" + fileName;
                if (!string.IsNullOrEmpty(saveFileName))
                {
                    fileName = saveFileName;
                }
                else
                {
                    System.Windows.Forms.SaveFileDialog sfd = new System.Windows.Forms.SaveFileDialog();
                    sfd.RestoreDirectory = true;
                    sfd.Filter           = "图片文件|*.jpg;*.bmp;*.png|全部文件|*.*";
                    sfd.FileName         = fileName;
                    sfd.InitialDirectory = Framework.Environment.PictureSavePath;
                    if (sfd.ShowDialog() == System.Windows.Forms.DialogResult.OK)
                    {
                        fileName = sfd.FileName;
                    }
                    else
                    {
                        needSave = false;
                    }
                }
                if (needSave)
                {
                    img.Save(fileName, System.Drawing.Imaging.ImageFormat.Jpeg);
                    img.Dispose();
                    return(fileName);
                }
                return("");
            }
            catch (SDKCallException ex)
            {
                MyLog4Net.Container.Instance.Log.DebugFormat("GrabPictureData error:" + ex);
                return("");
            }
        }
 /// <summary>Snippet for GetVideo</summary>
 public void GetVideoResourceNames()
 {
     // Snippet: GetVideo(VideoName, CallSettings)
     // Create client
     VideoServiceClient videoServiceClient = VideoServiceClient.Create();
     // Initialize request argument(s)
     VideoName resourceName = VideoName.FromCustomerVideo("[CUSTOMER]", "[VIDEO]");
     // Make the request
     Video response = videoServiceClient.GetVideo(resourceName);
     // End snippet
 }
Example #7
0
 /// <summary>Snippet for GetVideo</summary>
 /// <remarks>
 /// This snippet has been automatically generated for illustrative purposes only.
 /// It may require modifications to work in your environment.
 /// </remarks>
 public void GetVideoRequestObject()
 {
     // Create client
     VideoServiceClient videoServiceClient = VideoServiceClient.Create();
     // Initialize request argument(s)
     GetVideoRequest request = new GetVideoRequest
     {
         ResourceNameAsVideoName = VideoName.FromCustomerVideo("[CUSTOMER]", "[VIDEO]"),
     };
     // Make the request
     Video response = videoServiceClient.GetVideo(request);
 }
        /// <summary>Snippet for GetVideoAsync</summary>
        /// <remarks>
        /// This snippet has been automatically generated for illustrative purposes only.
        /// It may require modifications to work in your environment.
        /// </remarks>
        public async Task GetVideoRequestObjectAsync()
        {
            // Create client
            VideoServiceClient videoServiceClient = await VideoServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetVideoRequest request = new GetVideoRequest
            {
                ResourceNameAsVideoName = VideoName.FromCustomerVideo("[CUSTOMER_ID]", "[VIDEO_ID]"),
            };
            // Make the request
            Video response = await videoServiceClient.GetVideoAsync(request);
        }
        /// <summary>Snippet for GetVideoAsync</summary>
        public async Task GetVideoResourceNamesAsync()
        {
            // Snippet: GetVideoAsync(VideoName, CallSettings)
            // Additional: GetVideoAsync(VideoName, CancellationToken)
            // Create client
            VideoServiceClient videoServiceClient = await VideoServiceClient.CreateAsync();

            // Initialize request argument(s)
            VideoName resourceName = VideoName.FromCustomerVideo("[CUSTOMER_ID]", "[VIDEO_ID]");
            // Make the request
            Video response = await videoServiceClient.GetVideoAsync(resourceName);

            // End snippet
        }
Example #10
0
    private void Complete(MediaPlayer arg0, MediaPlayerEvent.EventType arg1, ErrorCode arg2)
    {
        switch (arg1)
        {
        case MediaPlayerEvent.EventType.FinishedPlaying:
            arg0.Stop();
            arg0.gameObject.GetComponent <CanvasGroup>().alpha = 0;
            Tips.alpha = 1;
            PingBaoStart();
            VideoName name = (VideoName)Enum.Parse(typeof(VideoName), arg0.name);
            switch (name)
            {
            case VideoName.Video:
                Button_Open(0);
                break;

            case VideoName.Video1:
                Button_Open(1);
                break;

            case VideoName.Video2:
                Button_Open(2);
                break;

            case VideoName.Video3:
                Button_Open(3);
                break;

            case VideoName.Video4:
                Button_Open(4);
                break;

            case VideoName.Video5:

                for (int i = 0; i < buttons.Length; i++)
                {
                    Button_Open(i);
                }
                break;

            default:
                break;
            }
            break;

        default:
            break;
        }
    }
        /// <summary>Snippet for GetVideoAsync</summary>
        public async Task GetVideoRequestObjectAsync()
        {
            // Snippet: GetVideoAsync(GetVideoRequest, CallSettings)
            // Additional: GetVideoAsync(GetVideoRequest, CancellationToken)
            // Create client
            VideoServiceClient videoServiceClient = await VideoServiceClient.CreateAsync();

            // Initialize request argument(s)
            GetVideoRequest request = new GetVideoRequest
            {
                ResourceNameAsVideoName = VideoName.FromCustomerVideo("[CUSTOMER]", "[VIDEO]"),
            };
            // Make the request
            Video response = await videoServiceClient.GetVideoAsync(request);

            // End snippet
        }
        protected void DropDownListBind()
        {
            SqlConnection con  = DataOperate.CreateCon();
            SqlCommand    cmd1 = new SqlCommand();

            cmd1.Connection = con;
            string teacher = Session["userName"].ToString();

            cmd1.CommandText = "select * from CourseInfo where teacher ='" + teacher + "'";
            SqlDataReader reader1 = null;

            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            reader1 = cmd1.ExecuteReader();
            CourseName.DataSource     = reader1;
            CourseName.DataTextField  = "courseName";
            CourseName.DataValueField = "courseId";
            CourseName.DataBind();
            if (con.State == ConnectionState.Open)
            {
                con.Close();
            }
            SqlCommand cmd2 = new SqlCommand();

            cmd2.Connection  = con;
            cmd2.CommandText = "select * from VideoInfo where CourseId ='" + CourseName.SelectedValue + "'";
            SqlDataReader reader2 = null;

            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            reader2 = cmd2.ExecuteReader();
            VideoName.DataSource     = reader2;
            VideoName.DataTextField  = "videoName";
            VideoName.DataValueField = "videoId";
            VideoName.DataBind();
            if (con.State == ConnectionState.Open)
            {
                con.Close();
            }
        }
Example #13
0
        private string GetVideoSource()
        {
            string libraryUrl = LibraryName.ToLower();
            string imageUrl   = VideoName.ToLower() + VideoType.ToLower();
            string url;

            if (this.Culture == null)
            {
                url = this.BaseUrl;
            }
            else
            {
                url = ActiveBrowser.Url.Substring(0, 20);
            }

            string scr = BATFeather.Wrappers().Frontend().MediaWidgets().MediaWidgetsWrapper().GetMediaSource(libraryUrl, imageUrl, "videos", currentProviderUrlName);

            return(scr);
        }
        public void GetVideo()
        {
            Mock <VideoService.VideoServiceClient> mockGrpcClient = new Mock <VideoService.VideoServiceClient>(MockBehavior.Strict);
            GetVideoRequest expectedRequest = new GetVideoRequest
            {
                ResourceName = new VideoName("[CUSTOMER]", "[VIDEO]").ToString(),
            };
            Video expectedResponse = new Video
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetVideo(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(expectedResponse);
            VideoServiceClient client = new VideoServiceClientImpl(mockGrpcClient.Object, null);
            string             formattedResourceName = new VideoName("[CUSTOMER]", "[VIDEO]").ToString();
            Video response = client.GetVideo(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        public async Task GetVideoAsync()
        {
            Mock <VideoService.VideoServiceClient> mockGrpcClient = new Mock <VideoService.VideoServiceClient>(MockBehavior.Strict);
            GetVideoRequest expectedRequest = new GetVideoRequest
            {
                ResourceName = new VideoName("[CUSTOMER]", "[VIDEO]").ToString(),
            };
            Video expectedResponse = new Video
            {
                ResourceName = "resourceName2625949903",
            };

            mockGrpcClient.Setup(x => x.GetVideoAsync(expectedRequest, It.IsAny <CallOptions>()))
            .Returns(new Grpc.Core.AsyncUnaryCall <Video>(Task.FromResult(expectedResponse), null, null, null, null));
            VideoServiceClient client = new VideoServiceClientImpl(mockGrpcClient.Object, null);
            string             formattedResourceName = new VideoName("[CUSTOMER]", "[VIDEO]").ToString();
            Video response = await client.GetVideoAsync(formattedResourceName);

            Assert.AreEqual(expectedResponse, response);
            mockGrpcClient.VerifyAll();
        }
        protected void CourseName_SelectedIndexChanged(object sender, EventArgs e)
        {
            SqlConnection con  = DataOperate.CreateCon();
            SqlCommand    cmd2 = new SqlCommand();

            cmd2.Connection  = con;
            cmd2.CommandText = "select * from VideoInfo where CourseId ='" + CourseName.SelectedValue + "'";
            SqlDataReader reader2 = null;

            if (con.State == ConnectionState.Closed)
            {
                con.Open();
            }
            reader2 = cmd2.ExecuteReader();
            VideoName.DataSource     = reader2;
            VideoName.DataTextField  = "videoName";
            VideoName.DataValueField = "videoId";
            VideoName.DataBind();
            if (con.State == ConnectionState.Open)
            {
                con.Close();
            }
        }
Example #17
0
    public void InsertIntoVideos()
    {
        string        query = string.Format("Insert into Videos(VideoName, Image, DateUploaded, UserName) values ('{0}','{1}','{2}','{3}');", VideoName.Replace("'", "''"), Image, DateUploaded, UserName);
        SqlConnection con   = new SqlConnection(ConfigurationManager.ConnectionStrings["VideoConnectionString"].ToString());
        SqlCommand    com   = new SqlCommand(query, con);

        try
        {
            con.Open();
            Convert.ToInt32(com.ExecuteScalar());
        }
        finally
        {
            con.Close();
        }
    }