Пример #1
0
        private void _nodeControl_PlayMediaIconClicked(object sender, RoutedEventArgs e)
        {
            MetadataContext videoSourceKey = new MetadataContext()
            {
                MetadataName = "Video.Source", NodeUid = Node.Id
            };
            string source = Node.GetNodeMetadata(videoSourceKey).MetadataValue;

            VideoSizeHelper sizeHelper = new VideoSizeHelper(Node);

            RelatedContentPanelUtil.Instance.LoadRelatedVideoContent(source, sizeHelper.Size);

            string  startPosition = null;
            string  endPosition   = null;
            Command playCommand   = new Command();

            playCommand.Name   = "Play";
            playCommand.Params = new List <Param>();
            playCommand.Params.Add(new Param()
            {
                Name = "Source", Value = source
            });
            playCommand.Params.Add(new Param()
            {
                Name = "NodeId", Value = Node.Id.ToString()
            });
            playCommand.Params.Add(new Param()
            {
                Name = "AutoPlay", Value = "true"
            });
            MetadataContext videoStartPosKey = new MetadataContext()
            {
                MetadataName = "Video.StartPosition", NodeUid = Node.Id
            };

            if (Node.HasMetadata(videoStartPosKey))
            {
                startPosition = Node.GetNodeMetadata(videoStartPosKey).MetadataValue;
                playCommand.Params.Add(new Param()
                {
                    Name = "StartTimeCode", Value = startPosition
                });
            }
            MetadataContext videoEndPosKey = new MetadataContext()
            {
                MetadataName = "Video.EndPosition", NodeUid = Node.Id
            };

            if (Node.HasMetadata(videoEndPosKey))
            {
                endPosition = Node.GetNodeMetadata(videoEndPosKey).MetadataValue;
                playCommand.Params.Add(new Param()
                {
                    Name = "EndTimeCode", Value = endPosition
                });
            }
            LocalMessageSender msgSender = IoC.IoCContainer.GetInjectionInstance().GetInstance <LocalMessageSender>();
            //Utilities.SendMessage<Command>(msgSender, playCommand);
        }
Пример #2
0
        private void playVideoMenuItem_Click(object sender, RoutedEventArgs e)
        {
            MetadataContext videoSourceKey = new MetadataContext()
            {
                MetadataName = "Video.Source",
                NodeUid      = NodeProxy.Id
            };
            string source = NodeProxy.GetNodeMetadata(videoSourceKey).MetadataValue;

            VideoSizeHelper sizeHelper = new VideoSizeHelper(NodeProxy);

            RelatedContentPanelUtil.Instance.LoadRelatedVideoContent(source, sizeHelper.Size);

            string  startPosition = null;
            string  endPosition   = null;
            Command playCommand   = new Command();

            playCommand.Name   = "Play";
            playCommand.Params = new List <Param>();
            playCommand.Params.Add(new Param()
            {
                Name = "Source", Value = source
            });
            MetadataContext videoStartKey = new MetadataContext()
            {
                MetadataName = "Video.StartPosition",
                NodeUid      = NodeProxy.Id
            };

            if (NodeProxy.HasMetadata(videoStartKey))
            {
                startPosition = NodeProxy.GetNodeMetadata(videoStartKey).MetadataValue;
                playCommand.Params.Add(new Param()
                {
                    Name = "StartTimeCode", Value = startPosition
                });
            }
            MetadataContext videoEndKey = new MetadataContext()
            {
                MetadataName = "Video.EndPosition",
                NodeUid      = NodeProxy.Id
            };

            if (NodeProxy.HasMetadata(videoEndKey))
            {
                endPosition = NodeProxy.GetNodeMetadata(videoEndKey).MetadataValue;
                playCommand.Params.Add(new Param()
                {
                    Name = "EndTimeCode", Value = endPosition
                });
            }
            playCommand.Params.Add(new Param()
            {
                Name = "NodeId", Value = NodeProxy.Id.ToString()
            });
            //Utilities.SendMessage<Command>(MessageSender, playCommand);
        }