public void Start()
    {
#if UNITY_WEBGL
        useNewVersion = true;
#endif

        resolver = gameObject.AddComponent <RequestResolver>();
        if (Application.isMobilePlatform)
        {
            if (GetMaxQualitySupportedByDevice() <= 720)
            {
                //low end device..
                if (videoQuality != VideoQuality.mediumQuality)
                {
                    videoQuality = VideoQuality.Hd720;
                }
                noHD = true;
            }
        }

        if (playOnStart)
        {
            PlayYoutubeVideo(videoId);
        }
    }
Exemplo n.º 2
0
    public void Start()
    {
        if (videoQuality == VideoQuality.Hd720)
        {
            noHD = true;
        }
#if UNITY_WEBGL
        useNewVersion = true;
#endif

        unityVideoPlayer.started             += VideoStarted;
        unityVideoPlayer.errorReceived       += VideoErrorReceived;
        unityVideoPlayer.frameDropped        += VideoFrameDropped;
        unityVideoPlayer.sendFrameReadyEvents = true;
        unityVideoPlayer.frameReady          += VideoFrameReady;

        resolver = gameObject.AddComponent <RequestResolver>();
        if (Application.isMobilePlatform)
        {
            if (GetMaxQualitySupportedByDevice() <= 720)
            {
                //low end device..
                if (videoQuality != VideoQuality.mediumQuality)
                {
                    videoQuality = VideoQuality.Hd720;
                }
                noHD = true;
            }
        }

        if (playOnStart)
        {
            PlayYoutubeVideo(videoId);
        }
    }
Exemplo n.º 3
0
        public async void Test_Txt_Request()
        {
            var url = "https://dexih.dataexpertsgroup.com";

            var httpRequest = new HttpClient();
            await httpRequest.GetAsync($"{url}/api/Remote/AddTxtRecord");

            var requestResolver = new RequestResolver(null, new DefaultHttpClientFactory(), RootAddress, new [] { "20.20.20.20" }, "dexih.com", "*****@*****.**", 123, 60, $"{url}/api/Remote/GetTxtRecords");

            var domain = new Domain("dexih.com");

            var question = new Question(domain, RecordType.TXT, RecordClass.IN);
            var request  = new Request(new Header(), new List <Question>()
            {
                question
            }, new List <IResourceRecord>());
            var resolve = await requestResolver.Resolve(request);

            var txtRecord = resolve.AnswerRecords.Where(c => c.Type == RecordType.TXT);

            Assert.True(txtRecord.Any());

            var value = Encoding.Default.GetString(txtRecord.First().Data).Substring(1);

            Assert.Equal("test0=sample value", value);
        }
 public WebSocketConnection(WebSocket socket, Action <string> log)
 {
     Log              = Console.WriteLine;
     Socket           = socket;
     _requestResolver = new RequestResolver();
     Task.Factory.StartNew(() => MonitorConnection(socket));
 }
Exemplo n.º 5
0
    public void Start()
    {
        //if (videoQuality == VideoQuality.SD360)
        //    noHD = true;
#if UNITY_WEBGL
        getFromWebserver = true;
#endif

        unityVideoPlayer.started       += VideoStarted;
        unityVideoPlayer.errorReceived += VideoErrorReceived;
        unityVideoPlayer.frameDropped  += VideoFrameDropped;

        resolver = gameObject.AddComponent <RequestResolver>();

        //if (Application.isMobilePlatform)
        //{
        //    if (GetMaxQualitySupportedByDevice() <= 720)
        //    {
        //        //low end device..
        //        if(videoQuality != VideoQuality.mediumQuality)
        //            videoQuality = VideoQuality.Hd720;
        //        noHD = true;
        //    }
        //}

        if (playOnStart)
        {
            PlayYoutubeVideo(videoId);
        }
    }
Exemplo n.º 6
0
 public void Start()
 {
     resolver = gameObject.AddComponent <RequestResolver>();
     if (playOnStart)
     {
         PlayYoutubeVideo(videoId);
     }
 }
 private void Start()
 {
     resolver = gameObject.AddComponent <RequestResolver>();
     if (playOnStart)
     {
         PlayVideo(videoUrl);
     }
 }
Exemplo n.º 8
0
    IEnumerator Start()
    {
        yield return(new WaitForSeconds(1));

        resolver = gameObject.AddComponent <RequestResolver>();
        unityVideoPlayer.errorReceived += PlayerError;
        yield return(new WaitForSeconds(1));

        if (playOnStart)
        {
            PlayYoutubeVideo(videoId);
        }
    }
Exemplo n.º 9
0
        } //END Start

        //------------------------------------//
        public void AddOrLinkRequestResolver()
        //------------------------------------//
        {
            if( requestResolver != null ) { return; }

            if( GetComponent<RequestResolver>() != null )
            {
                requestResolver = GetComponent<RequestResolver>();
            }
            else
            {
                requestResolver = gameObject.AddComponent<RequestResolver>();
            }

        } //AddOrLinkRequestResolver();
Exemplo n.º 10
0
        public void Test_Dynamic_A_Request()
        {
            var requestResolver = new RequestResolver(null, null, RootAddress, new [] { "20.20.20.20" }, "dexih.com", "*****@*****.**", 123, 60, "abc");

            var question = new Question(new Domain("127-0-0-1.abc.dexih.com"), RecordType.A, RecordClass.IN);

            var request = new Request(new Header(), new List <Question>()
            {
                question
            }, new List <IResourceRecord>());
            var resolve = requestResolver.Resolve(request).Result;

            Assert.Equal(1, resolve.AnswerRecords.Count);

            Assert.IsType <IPAddressResourceRecord>(resolve.AnswerRecords[0]);

            var record = (IPAddressResourceRecord)resolve.AnswerRecords[0];

            Assert.Equal("127.0.0.1", record.IPAddress.ToString());
        }
    public void OnEnable()
    {
        videoId = ControlVideos.YoutubeVideoCode; // makes the video play based on the video code in the button

        resolver = gameObject.AddComponent <RequestResolver>();
        if (Application.isMobilePlatform)
        {
            if (GetMaxQualitySupportedByDevice() <= 720)
            {
                //low end device..
                if (videoQuality != VideoQuality.mediumQuality)
                {
                    videoQuality = VideoQuality.Hd720;
                }
                noHD = true;
            }
        }

        if (playOnStart)
        {
            PlayYoutubeVideo(videoId);
        }
    }
Exemplo n.º 12
0
 public RenameService(FileRenamer renamer, RequestResolver resolver, FileInfoService fileInfoService)
 {
     this.renamer         = renamer;
     this.resolver        = resolver;
     this.fileInfoService = fileInfoService;
 }
Exemplo n.º 13
0
 private void Start()
 {
     instance = this;
     resolver = gameObject.AddComponent <RequestResolver>();
 }
Exemplo n.º 14
0
 public void RegisterResolver(RequestResolver resolver)
 {
     this.resolver = resolver;
 }
Exemplo n.º 15
0
 public void Start()
 {
     resolver = gameObject.AddComponent <RequestResolver>();
     GetURL(videoId);
 }
Exemplo n.º 16
0
 public void Start()
 {
     isPrepared            = false;
     youtubePlayer.enabled = false;
     resolver = gameObject.AddComponent <RequestResolver>();
 }
Exemplo n.º 17
0
 private void Awake()
 {
     _reqResolver = GetComponent <RequestResolver>();
 }