Esempio n. 1
0
    public override void PlaySpherical()
    {
        movie.UnloadMovie();
        string url   = "file://" + path;
        Fader  fader = Sphere.GetComponent <Fader>();

        Debug.Log(url);
        StartCoroutine(LoadImageCo(url, image =>
        {
            fader.DoFade();
            Resources.UnloadUnusedAssets();
            Material tempMaterial          = Sphere.GetComponent <Renderer>().material;
            tempMaterial.mainTextureOffset = new Vector2(0, 0);
            tempMaterial.mainTextureScale  = new Vector2(1, 1);
            tempMaterial.mainTexture       = image;

            //sphereAnchorer.ResetRotation();



            VideoControls.SetActive(false);
            toggleButton.gameObject.SetActive(true);
            toggleButton.Play();
            Debug.Log("stuck");
        }));
    }
Esempio n. 2
0
 public void ClearLayout()
 {
     AudioControls.All((i) => i.Stop());
     VideoControls.All((i) => i.Stop());
     foreach (var el in m_LoadedCanvasItems)
     {
         myCanvas.Children.Remove(el);
     }
     //documentviewWord.Document = new FixedDocument();
 }
Esempio n. 3
0
        protected override async void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            InitializeComponent();

            var args = e.Parameter as IActivatedEventArgs;

            // Check if any arguments were passed
            if (args != null)
            {
                // Open with...
                if (args.Kind == ActivationKind.File)
                {
                    // Get the first file
                    // TODO: Get all the files and put them in a collection
                    var    fileArgs    = args as FileActivatedEventArgs;
                    string strFilePath = fileArgs.Files[0].Path;
                    var    file        = (StorageFile)fileArgs.Files[0];

                    VideoPlayer.streamcb_file = (StorageFile)fileArgs.Files[0];
                    await Task.Run(() =>
                    {
                        Task <Stream> tmp           = VideoPlayer.streamcb_file.OpenStreamForReadAsync();
                        VideoPlayer.streamcb_stream = tmp.Result;
                    });

                    while (VideoPlayer.MediaPlayer == null)
                    {
                        System.Diagnostics.Debug.WriteLine("Internal MediaPlayer Core still uninitialized, waiting...");
                    }

                    VideoPlayer.MediaPlayer.StreamCbAddReadOnly("buffer", strFilePath, VideoPlayer.StreamCbOpenFn);
                    VideoPlayer.MediaPlayer.ExecuteCommand("loadfile", "buffer://fake");

                    var prop = VideoPlayer.MediaPlayer.GetProperty("duration");
                    while (prop == null)
                    {
                        System.Diagnostics.Debug.WriteLine("property was null, retrying");
                        prop = VideoPlayer.MediaPlayer.GetProperty("duration");
                    }
                    Double duration = Double.Parse(prop, CultureInfo.InvariantCulture.NumberFormat);
                    prop = VideoPlayer.MediaPlayer.GetProperty("demuxer-rawvideo-fps");
                    while (prop == null)
                    {
                        System.Diagnostics.Debug.WriteLine("property was null, retrying");
                        prop = VideoPlayer.MediaPlayer.GetProperty("duration");
                    }
                    Double fps = Double.Parse(prop, CultureInfo.InvariantCulture.NumberFormat);
                    VideoControls.SetSliderDuration(duration, 1 / fps);
                }
            }
        }
Esempio n. 4
0
    public override void PlaySpherical()
    {
        Fader fader = Sphere.GetComponent <Fader>();

        fader.DoFade();

        movie._filename = path;
        movie.LoadMovie(true);
        VideoControls.SetActive(true);
        toggleButton.gameObject.SetActive(true);
        toggleButton.Play();
        sphereAnchorer.ResetRotation();
    }
Esempio n. 5
0
    void Start()
    {
        instance = this;

        //Set listeners
        buttonPauseResume.onClick.AddListener(PauseResumeVideo);
        buttonReplayVideo.onClick.AddListener(ReplayVideo);
        buttonBackToBrowse.onClick.AddListener(BackToVideoBrowser);

        ShowReplayButton(false);

        buttonMuteVolume.onClick.AddListener(MuteVolume);
        //toggleMuteVolume.onValueChanged.AddListener(mute => MuteVolume(mute));

        //These are tests to be activated in the 2.0 template

        /*
         * buttonForward.onClick.AddListener (ForwardVideo);
         * buttonRewind.onClick.AddListener (RewindVideo);
         */
    }