Example #1
0
        public string GetUrlVideoRevisao(string nomeArquivoXml, Utilidades.VideoThumbSize resolucao, string UrlStream, string UrlMp4, int?videoId, int idAplicacao = (int)Aplicacoes.MEDSOFT, string versaoApp = "")
        {
            string urlRetorno = null;
            string versao     = versaoApp != "" ? versaoApp : ConfigurationProvider.Get("ChaveamentoVersaoMinimaMsPro");

            int intAplicacao = idAplicacao == Aplicacoes.MEDSOFT.GetHashCode() ? Aplicacoes.MEDSOFT.GetHashCode() : idAplicacao;

            if (ChaveamentoVimeoAulaDeRevisao())
            {
                if (intAplicacao == (int)Aplicacoes.AreaRestrita)
                {
                    urlRetorno = !string.IsNullOrEmpty(UrlStream) ? UrlStream : this.ObterURLVimeoPorIntVideoID(Convert.ToInt32(videoId), intAplicacao);
                }
                else if (intAplicacao == (int)Aplicacoes.MEDSOFT_PRO_ELECTRON)
                {
                    Business.VersaoAppPermissaoBusiness versaoAppPermissao = new VersaoAppPermissaoBusiness(new VersaoAppPermissaoEntity());

                    if (versaoAppPermissao.VersaoMenorOuIgual(versao, ConfigurationProvider.Get("ChaveamentoVersaoMinimaMsProDesktop")))
                    {
                        urlRetorno = !string.IsNullOrEmpty(UrlMp4) ? UrlMp4 : this.ObterURLVimeoPorIntVideoID(Convert.ToInt32(videoId), intAplicacao);
                    }
                    else
                    {
                        urlRetorno = !string.IsNullOrEmpty(UrlStream) ? UrlStream : this.ObterURLVimeoPorIntVideoID(Convert.ToInt32(videoId), intAplicacao);
                    }
                }
                else //outras aplicações, como Mobile
                {
                    urlRetorno = !string.IsNullOrEmpty(UrlMp4) ? UrlMp4 : this.ObterURLVimeoPorIntVideoID(Convert.ToInt32(videoId), intAplicacao);
                }
            }

            if (string.IsNullOrEmpty(urlRetorno))
            {
                var nomeConcatenado = string.Format("{0}-{1}", nomeArquivoXml.Replace(".xml", string.Empty), Convert.ToInt32(resolucao));
                urlRetorno = Criptografia.GetSignedPlayer(nomeConcatenado);
            }

            return(urlRetorno);
        }
Example #2
0
        public string GetUrlThumbVideoRevisao(string nomeArquivoXml, Utilidades.VideoThumbSize resolucao, string UrlThumb, int?vimeoId)
        {
            string urlRetorno = null;

            if (ChaveamentoVimeoAulaDeRevisao())
            {
                if (!string.IsNullOrEmpty(UrlThumb))
                {
                    urlRetorno = UrlThumb;
                }
                else if (vimeoId != null)
                {
                    this.ObterURLThumbVimeo(Convert.ToInt32(vimeoId));
                }
            }

            if (string.IsNullOrEmpty(urlRetorno))
            {
                urlRetorno = string.Format(@"http://content.jwplatform.com/thumbs/{0}-{1}.jpg", nomeArquivoXml.Replace(".xml", string.Empty), Convert.ToInt32(resolucao));
            }

            return(urlRetorno);
        }
Example #3
0
 public static string GetUrlThumb(string key, Utilidades.VideoThumbSize size)
 {
     // REF: https://developer.jwplayer.com/jw-platform/reference/v1/urls/thumbs.html
     return(string.Format(@"http://content.jwplatform.com/thumbs/{0}-{1}.jpg", key, Convert.ToInt32(size)));
 }