Esempio n. 1
0
    private void PickVideo()
    {
        NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) =>
        {
            Debug.Log("Video path: " + path);
            if (path != null)
            {
                // Play the selected video
                Handheld.PlayFullScreenMovie("file://" + path);
            }
        }, "Select a video");

        Debug.Log("Permission result: " + permission);
        CanvasToHide.SetActive(true);
    }
Esempio n. 2
0
    // Use this for initialization
    IEnumerator Start()
    {
        loadingScreen.Instance.Disapear();
        yield return(new WaitForSeconds(1));

#if UNITY_ANDROID
        Handheld.PlayFullScreenMovie("Intro.mp4", Color.white, FullScreenMovieControlMode.Hidden);
        loadingScreen.Instance.Show("Play");
#else
        MovieImg.texture = movie;
        loadingScreen.Instance.Disapear();
        //movie.Play();
        loadingScreen.Instance.Show("Play");
#endif
    }
Esempio n. 3
0
        public override void Draw()
        {
            if (_video == null)
            {
                return;
            }
            base.Draw();

            GUI.DrawTexture(_iconRect, _icon);
            if (GUI.Button(_iconRect, "", GUIStyle.none))
            {
                var path = _video.Path.StartsWith("/") ? _video.Path : System.IO.Path.Combine(Application.persistentDataPath, _video.Path);
                Handheld.PlayFullScreenMovie("file://" + path, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFit);
            }
        }
    IEnumerator Play(string url)
    {
        Debug.Log("Play!");
#if UNITY_IPHONE || UNITY_ANDROID
        Handheld.PlayFullScreenMovie(url, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.Fill);
#else
        Debug.Log("This only runs in mobile");
#endif
        yield return(new WaitForSeconds(1));

        if (VideoFinished != null)
        {
            VideoFinished.Invoke();
        }
    }
Esempio n. 5
0
    // Invoked by NatCorder video recorder once video recording is complete
    private void OnRecording(string path)
    {
        Debug.Log($"Saved recording to: {path}");
        var prefix = Application.platform == RuntimePlatform.IPhonePlayer ? "file://" : "";

        if (shareRecording)
        {
            using (var payload = new SharePayload())
                payload.AddMedia(path);
        }
        else
        {
            Handheld.PlayFullScreenMovie($"{prefix}{path}");
        }
    }
    private IEnumerator DoPlayVideo()
    {
        float startTime = Time.realtimeSinceStartup;

        Handheld.PlayFullScreenMovie(_filename, _backgroundColor, FullScreenMovieControlMode.CancelOnInput, FullScreenMovieScalingMode.AspectFit);

        yield return(null);

        float duration = Time.realtimeSinceStartup - startTime;

        if (_durationToDetectSkip > 0.0f)
        {
            _skippedPercentage = Mathf.Clamp01(duration / _durationToDetectSkip);
        }
    }
Esempio n. 7
0
    //public MovieTexture _Ending_movie;
    //public Text _text;
    //private AudioSource audio;
    //private bool xxx = false;

//	public MovieTexture video;
//	private AudioSource aa;

    //public bool aa = false;


    // Use this for initialization
    void Start()
    {
//		GetComponent<Renderer> ().material.mainTexture = video as MovieTexture;
//		aa = GetComponent<AudioSource> ();
//		video.Play ();

        //_text.gameObject.SetActive (false);
        //GetComponent<RawImage> ().texture = _Ending_movie as MovieTexture;
        //audio = GetComponent<AudioSource> ();
        //audio.clip = _Ending_movie.audioClip;
        //_Ending_movie.Play ();
        //audio.Play ();
        //print(Handheld.PlayFullScreenMovie ("Tutorial_ending.mp4",Color.black,FullScreenMovieControlMode.CancelOnInput));
        Handheld.PlayFullScreenMovie("Tutorial_ending.mp4", Color.black, FullScreenMovieControlMode.Hidden);
    }
Esempio n. 8
0
    private void PickVideo()
    {
        NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) =>
        {
            Debug.Log("Ruta del video: " + path);

            if (path != null)
            {
                // Muestra el video seleccionado
                Handheld.PlayFullScreenMovie("file://" + path);
            }
        }, "Selecciona un video");

        Debug.Log("Resultado de los permisos: " + permission);
    }
Esempio n. 9
0
    // Use this for initialization
    void Start()
    {
        Handheld.PlayFullScreenMovie(VideoPlaybackHandle.video_url, Color.black, FullScreenMovieControlMode.CancelOnInput);
        int i = 0;

        Debug.Log(VideoPlaybackHandle.recommendations[0]);
        if (VideoPlaybackHandle.recommendations.Count != 0)
        {
            foreach (string r in VideoPlaybackHandle.recommendations)
            {
                textFields [i].text = r;
                i++;
            }
        }
    }
Esempio n. 10
0
 private void OnMouseDown()
 {
     if (!UsingPC)
     {
         Handheld.PlayFullScreenMovie(videoPath, MobileVideoBackgroundColor, MobileVideoControlMode, MobileVideoScalingMode);
         Screen.orientation = ScreenOrientation.LandscapeLeft;
     }
     else
     {
         VuforiaBehaviour.Instance.enabled = false;
         PCVideoPlayer.url = Application.streamingAssetsPath + "/" + videoPath;
         PCVideoPlayer.Play();
         usingPCVideoPlayer = true;
     }
 }
Esempio n. 11
0
    /// <summary>
    /// Play the movie
    /// </summary>
    public void Play()
    {
        if (Input.GetMouseButtonDown(0))
        {
            SceneManager.LoadScene("TheSillyBird");
        }
        if (string.IsNullOrEmpty(movieFileName))
        {
            Debug.Log("movieFileName is undefined");
            return;
        }
#if UNITY_ANDROID || UNITY_IPHONE
        //Play full screen only
        Handheld.PlayFullScreenMovie("cabbar.mp4", backgroundColor, controlMod, scalingMod);
#endif
    }
Esempio n. 12
0
        public void Finish(string outputVideo)
        {
            startBtn.interactable = true;
            Debug.Log("Video saved to: " + outputVideo);
            string localURL = "file://" + outputVideo;

#if (UNITY_IOS || UNITY_ANDROID) && !UNITY_EDITOR
            Handheld.PlayFullScreenMovie(
                localURL,
                Color.black,
                FullScreenMovieControlMode.Full,
                FullScreenMovieScalingMode.AspectFit);
#else
            Application.OpenURL(localURL);
#endif
        }
    private void RecordVideo()
    {
        NativeCamera.Permission permission = NativeCamera.RecordVideo((path) =>
        {
            //textUIValue.text = "Video path: " + path;

            Debug.Log("Video path: " + path);
            if (path != null)
            {
                // Play the recorded video
                Handheld.PlayFullScreenMovie("file://" + path);
            }
        });

        Debug.Log("Permission result: " + permission);
    }
Esempio n. 14
0
 IEnumerator FadeOut()
 {
     player.GetComponent <Moving_by_RLbuttons> ().enabled = false;
     for (float f = 0f; f < 1; f += Time.deltaTime)
     {
         Color c = _blackout.color;
         c.a             = f;
         _blackout.color = c;
         yield return(null);
     }
     _ic.SetActive(false);
     _Canvas.SetActive(true);
     Handheld.PlayFullScreenMovie("Tutorial_ending.mp4", Color.black, FullScreenMovieControlMode.Hidden);
     Invoke("Active_Text", 2f);
     //player.GetComponent<Moving_by_RLbuttons> ().enabled = true;
 }
Esempio n. 15
0
    private void PickVideo()
    {
        NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) =>
        {
            Debug.Log("Video path: " + path);
            statusText.text = path;
            uploadscript.m_LocalFileName = path;
            if (path != null)
            {
                // Play the selected video
                Handheld.PlayFullScreenMovie("file://" + path);
            }
        }, "Select a video");

        Debug.Log("Permission result: " + permission);
    }
Esempio n. 16
0
        IEnumerator CoPlayMobileMovie(string path)
        {
            isPlaying = true;
            if (!cancel)
            {
                Handheld.PlayFullScreenMovie(path, bgColor);
            }
            else
            {
                Handheld.PlayFullScreenMovie(path, bgColor, FullScreenMovieControlMode.CancelOnInput);
            }
            yield return(new WaitForEndOfFrame());

            yield return(new WaitForEndOfFrame());

            isPlaying = false;
        }
Esempio n. 17
0
    public void TriggerMovie()
    {
        Debug.Log("TriggerMovie");

        /*if((!willOpen) || (willOpen && !isPopupOpen)){
         *      currentAnimation = VideoOverlayPanel.GetComponent<Animation>();
         *      TogglePOI(willOpen);
         *
         *      isPopupOpen = willOpen;
         *
         *      //MovieM.ToggleMovie(willOpen);
         * }*/

        Handheld.PlayFullScreenMovie("SKOPEFactoryTour.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput);

        //Handheld.PlayFullScreenMovie ("SkopeMovie.mp4", Color.black, FullScreenMovieControlMode.CancelOnInput);
    }
Esempio n. 18
0
 void OnVideoSave(SaveMode mode, string path)
 {
     // Log
     Debug.Log("Recorded video to path: " + path);
     // Save to gallery
     if (saveToGallery && NatCam.Implementation.SaveVideo(path))
     {
         Debug.Log("Saved video to gallery");
     }
     #if !UNITYEDITOR && (UNITY_IOS || UNITY_ANDROID)
     // Play video
     if (playVideo)
     {
         Handheld.PlayFullScreenMovie(path, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFill);
     }
     #endif
 }
Esempio n. 19
0
        IEnumerator PlayFun()
        {
            mSkiping = true;
            mSkipBt.gameObject.SetActive(false);
            Color color = mImage.color;

            color.a = 1;

            while (color.r > 0)
            {
                float dp = Time.deltaTime * 2.0f;
                color.r       -= dp;
                color.g       -= dp;
                color.b       -= dp;
                mDec.color     = color;
                mImage.color   = color;
                mSource.volume = color.r;
                yield return(0);
            }
            mImage.color = color;
            yield return(0);

            if (!mIsPlay)
            {
#if FACEBOOK_SDK
                AppsFlyerMgr.LookVideo(9);
#if UNITY_ANDROID
                FireBaseMgr.LookVideo(9);
#endif
#endif
                mIsPlay = true;
                Handheld.PlayFullScreenMovie("null.mp4", Color.black, FullScreenMovieControlMode.Hidden, FullScreenMovieScalingMode.Fill);
            }
            yield return(0);

            yield return(0);

            yield return(new WaitForSeconds(0.3f));

            mImage.color = Color.black;

            yield return(0);

            CloseMySelf();
        }
Esempio n. 20
0
    void OnEnable()
    {
        if (string.IsNullOrEmpty(mName))
        {
            return;
        }

        CreateMark();
        //if(Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)

#if UNITY_STANDALONE_WIN || UNITY_EDITOR
#else
        Handheld.PlayFullScreenMovie(mName, mCol, (FullScreenMovieControlMode)mMode, (FullScreenMovieScalingMode)mScal);
#endif

        DestroyMark();
        DestroyObject(gameObject);
    }
Esempio n. 21
0
    /// <summary>
    /// Request a movie to be played either full screen or on texture and at a given position
    /// </summary>
    public bool Play(bool fullScreen, float seekPosition)
    {
        // We use Unity's built-in full screen movie player
        if (fullScreen)
        {
            if (mFilename == null)
            {
                return(false);
            }

            Handheld.PlayFullScreenMovie(mFullScreenFilename, Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFit);
            return(true);
        }
        else
        {
            return(videoPlayerPlay(fullScreen, seekPosition));
        }
    }
Esempio n. 22
0
    public void loadLevel(int levelIndex)
    {
        GameObject[] hideObjects = GameObject.FindGameObjectsWithTag("hideUI");
        foreach (GameObject hideObject in hideObjects)
        {
            hideObject.SetActive(false);
        }

        levelSelect.SetActive(false);
        loadingText.SetActive(true);

        if (levelIndex == 4)
        {
            Handheld.PlayFullScreenMovie("dwarfPlanetIntro.mp4", Color.black, FullScreenMovieControlMode.Full, FullScreenMovieScalingMode.AspectFit);
        }

        UnityEngine.SceneManagement.SceneManager.LoadScene(levelIndex);
    }
Esempio n. 23
0
    public IEnumerator LoadVideo(string vId)
    {
        //Dont change this url
        //If you change the video will not work
        string  url  = serverGetVideoFile + "?videoid=" + vId + "&type=Download";
        WWWForm form = new WWWForm();

        form.AddField("key", "youtubeDownloader");
        WWW www = new WWW(url, form);

        yield return(www);

        string result = www.text;

        Debug.Log(result);

        Handheld.PlayFullScreenMovie(result, Color.black, FullScreenMovieControlMode.Full);
    }
Esempio n. 24
0
    IEnumerator PlayVideoCoroutine(string videoPath)
    {
        Handheld.PlayFullScreenMovie(videoPath, Color.black, FullScreenMovieControlMode.CancelOnInput);
        yield return(new WaitForEndOfFrame());

        // Debug.Log("Video playback completed.");
        GameKernel.actionManager.RunAction(new ActionSequence(gameObject,
                                                              new ActionDelay(gameObject, 0.5f),
                                                              new ActionCallFunc(gameObject, (object obj) => {
            GameKernel.levelManager.ChangeLevel(
                GameKernel.levelManager.CreateCommonLevel(nextLevel),
                true
                );
        },
                                                                                 null
                                                                                 )
                                                              ));
    }
    private void OnReplay(string path)
    {
        Debug.Log("Saved recording to: " + path);
        lastVideoPath = path;
        PhotoAndVideoManager.Instance.ShowPhotoSave(null);

        return;

        // Playback the video
#if UNITY_EDITOR
        EditorUtility.OpenWithDefaultApp(path);
#elif UNITY_IOS
        Handheld.PlayFullScreenMovie("file://" + path);
#elif UNITY_ANDROID
        //OriginBridge.CallJaveMethod(OriginBridge.md_shareImageTo,(int)SharePlatform.system,path);
        Handheld.PlayFullScreenMovie(path);
#endif
    }
Esempio n. 26
0
        private static IEnumerator PlayVideoCoroutine(System.Action action, string Mp4Name)
        {
            if (!Handheld.PlayFullScreenMovie(string.Format("{0}.mp4", Mp4Name), Color.black, FullScreenMovieControlMode.Hidden))
            {
                EB.Debug.LogWarning("PlayVideoCoroutine: failed to play {0}.mp4", Mp4Name);
                action?.Invoke();
                yield break;
            }

            yield return(new WaitForEndOfFrame());

            EB.Debug.Log("PlayVideoCoroutine: application paused to play video");
            yield return(new WaitForEndOfFrame());

            EB.Debug.Log("PlayVideoCoroutine: application resumed by video playback completed");

            action?.Invoke();
        }
Esempio n. 27
0
        /// <summary>
        /// Raises the play video full screen button click event.
        /// </summary>
        public void OnPlayVideoFullScreenButtonClick()
        {
            Debug.Log("OnPlayVideoFullScreenButtonClick ()");

            if (isVideoPlaying || NatCorder.IsRecording || string.IsNullOrEmpty(videoPath))
            {
                return;
            }

            // Playback the video
            #if UNITY_IOS && !UNITY_EDITOR
            Handheld.PlayFullScreenMovie("file://" + videoPath);
            #elif UNITY_ANDROID && !UNITY_EDITOR
            Handheld.PlayFullScreenMovie(videoPath);
            #else
            Debug.LogWarning("Full-screen video playback is not supported on this platform.");
            #endif
        }
Esempio n. 28
0
    public void ShowModal(bool exitable)
    {
        Show();

#if UNITY_ANDROID
        Handheld.PlayFullScreenMovie("Tutorial.mp4", Color.black);
#else
        tutorialVideo.loop = true;
        if (tutorialVideo.isPlaying)
        {
            tutorialVideo.Stop();
        }
        tutorialVideo.Play();
#endif


        this.isExitable = exitable;
    }
Esempio n. 29
0
    /// <summary>
    /// Pick a video from Gallery/Photos
    /// uses NativeGallery
    /// </summary>
    public void PickVideo()
    {
        if (NativeGallery.IsMediaPickerBusy())
        {
            return;
        }

        NativeGallery.Permission permission = NativeGallery.GetVideoFromGallery((path) =>
        {
            Debug.Log("Video path: " + path);
            if (path != null)
            {
                // Play the selected video
                Handheld.PlayFullScreenMovie("file://" + path);
            }
        }, "Select a video");

        Debug.Log("Permission result: " + permission);
    }
Esempio n. 30
0
 // Invoked by NatCorder once video recording is complete
 private void OnRecording(string path)
 {
     // Share
     if (shareRecordings)
     {
         NatShare.ShareMedia(path);
     }
     // Playback the recording
     else
     {
                     #if UNITY_EDITOR
         UnityEditor.EditorUtility.OpenWithDefaultApp(path);
                     #elif UNITY_IOS
         Handheld.PlayFullScreenMovie("file://" + path);
                     #elif UNITY_ANDROID
         Handheld.PlayFullScreenMovie(path);
                     #endif
     }
 }