IsRecordingSupported() публичный статический Метод

public static IsRecordingSupported ( ) : bool
Результат bool
Пример #1
0
    //=============================================================================

    public static bool IsRecordingSupported()
    {
                #if UNITY_IPHONE || UNITY_ANDROID
        return(Everyplay.IsRecordingSupported());
                #else
        return(false);
                #endif
    }
Пример #2
0
        /// <summary>
        /// Returns whether Everplay recording is supported on the device.
        /// </summary>
        public static bool IsRecordingSupported()
        {
            bool supported = false;

                        #if UNITY_EVERYPLAY
            supported = Everyplay.IsRecordingSupported();
                        #endif

            return(supported);
        }
    void Awake()
    {
        // Scale by resolution
        containerScaling = GetScalingByResolution();

        // Texture atlas sources
        editVideoAtlasSrc        = new TextureAtlasSrc(112, 19, 0, 0, containerScaling);
        faceCamAtlasSrc          = new TextureAtlasSrc(103, 19, 116, 0, containerScaling);
        openEveryplayAtlasSrc    = new TextureAtlasSrc(178, 23, 0, 23, containerScaling);
        shareVideoAtlasSrc       = new TextureAtlasSrc(134, 19, 0, 50, containerScaling);
        startRecordingAtlasSrc   = new TextureAtlasSrc(171, 23, 0, 73, containerScaling);
        stopRecordingAtlasSrc    = new TextureAtlasSrc(169, 23, 0, 100, containerScaling);
        facecamToggleOnAtlasSrc  = new TextureAtlasSrc(101, 42, 0, 127, containerScaling);
        facecamToggleOffAtlasSrc = new TextureAtlasSrc(101, 42, 101, 127, containerScaling);
        bgHeaderAtlasSrc         = new TextureAtlasSrc(256, 9, 0, 169, containerScaling);
        bgFooterAtlasSrc         = new TextureAtlasSrc(256, 9, 0, 169, containerScaling);
        bgAtlasSrc     = new TextureAtlasSrc(256, 6, 0, 178, containerScaling);
        buttonAtlasSrc = new TextureAtlasSrc(220, 64, 0, 190, containerScaling);

        buttonTitleHorizontalMargin = Mathf.RoundToInt(buttonTitleHorizontalMargin * containerScaling);
        buttonTitleVerticalMargin   = Mathf.RoundToInt(buttonTitleVerticalMargin * containerScaling);
        buttonMargin = Mathf.RoundToInt(buttonMargin * containerScaling);

        // Buttons
        shareVideoButton     = new Button(buttonAtlasSrc, shareVideoAtlasSrc, ShareVideo);
        editVideoButton      = new Button(buttonAtlasSrc, editVideoAtlasSrc, EditVideo);
        openEveryplayButton  = new Button(buttonAtlasSrc, openEveryplayAtlasSrc, OpenEveryplay);
        startRecordingButton = new Button(buttonAtlasSrc, startRecordingAtlasSrc, StartRecording);
        stopRecordingButton  = new Button(buttonAtlasSrc, stopRecordingAtlasSrc, StopRecording);
        faceCamToggleButton  = new ToggleButton(buttonAtlasSrc, faceCamAtlasSrc, FaceCamToggle, facecamToggleOnAtlasSrc, facecamToggleOffAtlasSrc);

        visibleButtons = new List <Button>();

        // Use header texture for footer by flipping it
        bgFooterAtlasSrc.normalizedAtlasRect.y      = bgFooterAtlasSrc.normalizedAtlasRect.y + bgFooterAtlasSrc.normalizedAtlasRect.height;
        bgFooterAtlasSrc.normalizedAtlasRect.height = -bgFooterAtlasSrc.normalizedAtlasRect.height;

        // Set initially visible buttons
        SetButtonVisible(startRecordingButton, true);
        SetButtonVisible(openEveryplayButton, true);
        SetButtonVisible(faceCamToggleButton, true);

        // Set initially
        if (!Everyplay.IsRecordingSupported())
        {
            startRecordingButton.enabled = false;
            stopRecordingButton.enabled  = false;
        }

        Everyplay.RecordingStarted           += RecordingStarted;
        Everyplay.RecordingStopped           += RecordingStopped;
        Everyplay.ReadyForRecording          += ReadyForRecording;
        Everyplay.FaceCamRecordingPermission += FaceCamRecordingPermission;
    }
Пример #4
0
    private void SetInteractable(bool interactable = true)
    {
#if EVERYPLAY_IPHONE || EVERYPLAY_ANDROID
        if (Everyplay.IsRecordingSupported() && _button != null)
        {
            _button.interactable = interactable;
        }
#else
        _button.interactable = false;
#endif
    }
Пример #5
0
    //=============================================================================

    public static void ResumeRecording()
    {
                #if UNITY_IPHONE || UNITY_ANDROID
        if (Everyplay.IsRecordingSupported())
        {
            Everyplay.ResumeRecording();
        }
        else
        {
            Debug.Log("Everyplay recording not supported");
        }
                #endif
    }
Пример #6
0
    //=============================================================================

    public static void ShowHomepageWithPath(string CurPath)
    {
                #if UNITY_IPHONE || UNITY_ANDROID
        if (Everyplay.IsRecordingSupported())
        {
            Everyplay.ShowWithPath(CurPath);
        }
        else
        {
            Debug.Log("Everyplay recording not supported");
        }
                #endif
    }
 // Use this for initialization
 void Start()
 {
     if (Everyplay.IsSupported() &
         Everyplay.IsRecordingSupported())
     {
         Parar();
         Iniciar();
     }
     else
     {
         //debugText.gameObject.SetActive(true);
         //debugText.text = "Nao e possivel iniciar a gravacao";
     }
 }
Пример #8
0
    void Start()
    {
        DebugLog("Everplay Control Start()!");

        if (!Everyplay.IsRecordingSupported())
        {
            ToogleRecord.interactable = false;
        }

        if (!Everyplay.FaceCamIsVideoRecordingSupported())
        {
            ButtonFaceCam.interactable = false;
        }
    }
Пример #9
0
        //Configures which UI elements are enabled
        private void Awake()
        {
            bool touchDevice = Input.touchSupported;

            for (int i = 0; i < m_TouchDevicesOnly.Length; i++)
            {
                m_TouchDevicesOnly[i].SetActive(touchDevice);
            }

            bool everyplaySupported = Everyplay.IsSupported() && Everyplay.IsRecordingSupported();

            for (int i = 0; i < m_EveryplayCompatibleDevicesOnly.Length; i++)
            {
                m_EveryplayCompatibleDevicesOnly[i].SetActive(everyplaySupported);
            }
        }
Пример #10
0
    //=============================================================================

    public static void StopRecording()
    {
                #if UNITY_IPHONE || UNITY_ANDROID
        if (Everyplay.IsRecordingSupported())
        {
            if (Everyplay.IsRecording() == true)
            {
                Everyplay.StopRecording();
            }
        }
        else
        {
            Debug.Log("Everyplay recording not supported");
        }
                #endif
    }
Пример #11
0
        /// <summary>
        /// Starts recording gameplay videos, if recording is supported for this device
        /// (determined by Everyplay) and the user enabled screen recording in the game settings.
        /// </summary>
        public static void StartRecord()
        {
                        #if UNITY_EVERYPLAY
            //don't record with recording turned off
            if (!bool.Parse(PlayerPrefs.GetString(PrefsKeys.recordGame)))
            {
                return;
            }

            //start recording if supported and ready
            if (Everyplay.IsRecordingSupported() && Everyplay.IsReadyForRecording())
            {
                Everyplay.StartRecording();
            }
                        #endif
        }
        public void OnReadyForVideoRecording(bool isReady)
        {
            // DebugUtils.Log("LevelCompleteScreenController.OnReadyForVideoRecording()");
            if (isVideoRecordingInited)
            {
                return;
            }

            isVideoRecordingInited = true;

            if (isReady && Everyplay.IsRecordingSupported())
            {
                return;
            }

            SetVideoSectionVisible(false);
        }
    private void Initialize()
    {
        if (!initialized && Everyplay.IsRecordingSupported())
        {
            // Limit width between 32 and 2048
            thumbnailWidth = Mathf.Clamp(thumbnailWidth, 32, 2048);

            // Thumbnails are always stored landscape in memory
            aspectRatio = (float)Mathf.Min(Screen.width, Screen.height) / (float)Mathf.Max(Screen.width, Screen.height);

            // Calculate height based on aspect ratio
            thumbnailHeight = (int)(thumbnailWidth * aspectRatio);

            // Check for npot support, always use pot textures for older Unitys versions and if npot support is not available
            npotSupported = false;

            #if !(UNITY_3_5 || UNITY_4_0 || UNITY_4_0_1)
            npotSupported = (SystemInfo.npotSupport != NPOTSupport.None);
            #endif
            int thumbnailPotWidth  = Mathf.NextPowerOfTwo(thumbnailWidth);
            int thumbnailPotHeight = Mathf.NextPowerOfTwo(thumbnailHeight);

            // Create empty textures for requested amount of thumbnails
            thumbnailTextures = new Texture2D[thumbnailCount];

            for (int i = 0; i < thumbnailCount; i++)
            {
                thumbnailTextures[i] = new Texture2D(npotSupported ? thumbnailWidth : thumbnailPotWidth, npotSupported ? thumbnailHeight : thumbnailPotHeight, textureFormat, false);
                // Always use clamp to assure texture completeness when npot support is restricted
                thumbnailTextures[i].wrapMode = TextureWrapMode.Clamp;
            }

            // Set thumbnail render target to the first texture
            currentThumbnailTextureIndex = 0;

            Everyplay.SetThumbnailTargetTexture(thumbnailTextures[currentThumbnailTextureIndex]);
            SetThumbnailTargetSize();

            // Add thumbnail take listener
            Everyplay.ThumbnailTextureReady += OnThumbnailReady;
            Everyplay.RecordingStarted      += OnRecordingStarted;

            initialized = true;
        }
    }
Пример #14
0
    public void OnRecordButtonClick()
    {
        if (!Everyplay.IsRecordingSupported())
        {
            messager.SetMessege("Запись видео не поддерживается вашим устройством");
        }
        else if (!Everyplay.IsReadyForRecording())
        {
            messager.SetMessege("Необходимо разовое подключение к интернету");
        }
        else
        {
            animator.SetBool(isRecordingParamId, !animator.GetBool(isRecordingParamId));
            photoBtn.interactable     = !photoBtn.interactable;
            switchCamBtn.interactable = !switchCamBtn.interactable;

            videoRecorder.ToggleRecord();
        }
    }
Пример #15
0
    //
    // video record control
    //

    public void StartRecord()
    {
        if (!Everyplay.IsRecordingSupported())
        {
            logger += "Video recording is not supported";
        }
        else if (!Everyplay.IsReadyForRecording())
        {
            logger += "Device is not ready for record";
        }
        else
        {
            if (PreRecordStarted != null)
            {
                PreRecordStarted();
            }
            Utils.Inst.Shedule(() => Everyplay.StartRecording(), delayBeforeRecordStarted);
        }
    }
Пример #16
0
 void RpcGameStarted()
 {
     if (PlayerDataManager.s_InstanceExists && PlayerDataManager.s_Instance.everyplayEnabled)
     {
         // Start recording!
         if (Everyplay.IsRecordingSupported())
         {
             SetGameSettings();
             Everyplay.StartRecording();
             if (m_GameSettings.mode != null)
             {
                 Everyplay.SetMetadata("game_mode", m_GameSettings.mode.modeName);
             }
             if (m_GameSettings.map != null)
             {
                 Everyplay.SetMetadata("level", m_GameSettings.map.name);
             }
         }
     }
 }
Пример #17
0
    //=============================================================================

    public static void ShareRecording(string CharacterName)
    {
                #if UNITY_IPHONE || UNITY_ANDROID
        if (Everyplay.IsRecordingSupported())
        {
            //if( PlayerManager.EveryplayOn )
            {
                // Set distance metadata
                Dictionary <string, object> dict = new Dictionary <string, object>();

                dict["Character"] = CharacterName;
                Everyplay.SetMetadata(dict);
                Everyplay.ShowSharingModal();
            }
        }
        else
        {
            Debug.Log("Everyplay recording not supported");
        }
                #endif
    }
Пример #18
0
    //=============================================================================

    public static void StartRecording()
    {
                #if UNITY_IPHONE || UNITY_ANDROID
        if (Everyplay.IsRecordingSupported())
        {
            if (Everyplay.IsRecording() == true)
            {
                Everyplay.StopRecording();
            }

            //if( PlayerManager.EveryplayOn )
            {
                Everyplay.SetMaxRecordingMinutesLength(1);
                Everyplay.StartRecording();
            }
        }
        else
        {
            Debug.Log("Everyplay recording not supported");
        }
                #endif
    }
Пример #19
0
    // RECORDING

    public bool everyplayIsRecordingSupported()
    {
        LogUtil.Log("everyplayIsRecordingSupported");
        return(Everyplay.IsRecordingSupported());
    }
Пример #20
0
 public bool IsRecordingSupported()
 {
     return(Everyplay.IsRecordingSupported());
 }