Question

Hi there I am working on a piece of software similar to Power Point. To add a video I add a video slide then select browse to search for the video. Once the video is added you have the option of right clicking on that video and within the options will be edit video. Selecting edit video will bring up another page with a media element and a slide bar below it with play, pause, stop buttons. When I call the video editor class from the main window class the video path is definitely getting passed over correctly (I have stepped through and found this) It adds the video path to the media element source but it never loads as though the path was never passed over. Within the editor there is a browse button to add more videos and when I add videos this way they appear correctly with the media elements.

The VideoWindow is the class for the video editor.

public VideoWindow(Video __video, Roots __roots)
    {

        InitializeComponent();

        _roots = __roots;
        string videoFilePathFull = "";
        foreach (string file in Directory.EnumerateFiles(_roots.RunTimeTemp, "*.mp4*", SearchOption.AllDirectories))
        {
            videoFilePathFull = file;
        }
        mediaElement1.Source = new Uri(videoFilePathFull, UriKind.Relative);
        _staticVideo = __video;
        _tempVideo.Path = videoFilePathFull;
        initVideo();

    }

The editVideoElement method is the method called within the main window

private void editVideoElement(object sender, RoutedEventArgs e) {

            string __vidFileName = "";
            DesignerItem __item = getSingleSelectedElement();
            ComponentProperties __props = _slideFactory.GetComponentProperties(__item.Name);
            __vidFileName = __props.Video.Path;


            VideoWindow __slideVideo = new VideoWindow(__props.Video, roots);
            __slideVideo.Owner = this;
            __slideVideo.ShowDialog();

    }
Was it helpful?

Solution

I was passing the video via __props.Video and within the page load of the VideoWindow class I was setting the media element to have the path. I have since created a method within the class which I call within the page load of the VideoWindow class if a path is ever passed over and now the path is being passed into the media element :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top