简体   繁体   English

如何在给定的帧中完整显示视频,而不仅仅是一部分?

[英]How to fully display a video in a given frame, not just a part?

I'm trying to figure out how software works I am not familiar with.我试图弄清楚我不熟悉的软件是如何工作的。 There is an Adobe Flex page that shows a streaming video from a camera in a frame of 240 * 120. If you double click on the video frame you get a new frame which shows the video in size 480 * 240.有一个 Adob​​e Flex 页面,它以 240 * 120 的帧显示来自相机的流视频。如果双击视频帧,您会得到一个新的帧,显示大小为 480 * 240 的视频。

The problem is: the smaller frame 240 * 120 only shows the top left part of what is shown in the large video frame, which shows the full video image.问题是:较小的帧 240 * 120 仅显示大视频帧中显示的左上角部分,它显示了完整的视频图像。 The detail is the same.细节是一样的。

What I want to achieve is that the full video is shown in the smaller frame as well.我想要实现的是完整视频也显示在较小的帧中。

If I search in the software for size 240 and 120 I arrive at a jsp which includes the following css snippet:如果我在软件中搜索 240 和 120 的大小,我会得到一个包含以下 css 片段的 jsp:

.video {
   height = "120", width = "240"
}

I replaced that css snippet with我用那个 css 片段替换了

.video {
   height = "100%", width = "100%"
}

but that didn't make any difference.但这没有任何区别。

Does anybody have a clue?有人有线索吗?

Thanks in advance!提前致谢!

******* Post scriptum: ******* ******* 后记:*******

@Lars: I wrote my question during the weekend from the top of my head. @Lars:周末我从头顶写了我的问题。 What you suggest I already had implemented.你的建议我已经实施了。 However I discovered that I had applied it to the wrong jsp.但是我发现我把它应用到了错误的jsp上。 I verified through viewing the source code in the browser that the following is deployed:我通过在浏览器中查看源代码验证了以下部署:

#intercomIframe {
    position:absolute;
    width:100%;
    height:100%;
    right:60;
    bottom:75;
    z-index:5"  
}

The original values were:原始值是:

 #intercomIframe {
    position:absolute;
    width:165px;
    height:128px;
    right:60;
    bottom:75;
    z-index:5"  
}

If I doubleclick on the video I get in a flex screen (extension .mxml) with the same video displayed in full.如果我双击视频,我会进入一个 flex 屏幕(扩展名 .mxml),并完整显示相同的视频。 Part of the responsible code for that view:该视图的部分负责代码:

<components:FilterBar 
  id="filterBar" 
  visible="{enableFiltering}"
>
  <system:VideoSourceControlBox 
    id="videoSourceControl" 
    stationId="{station.id}" 
    autoSelect="true" 
    startSource="showVideo(true)" 
    stopSource="showVideo(false)" 
  />
</components:FilterBar>

<mx:Box 
  width="100%" height="100%" 
  backgroundColor="#e7ebf1" 
  paddingTop="15" paddingBottom="15" 
  paddingRight="15"paddingLeft="15"
>
  <mx:VBox 
    width="100%" height="100%" minHeight="0"
    cornerRadius="8"
    paddingTop="15" paddingBottom="15"
    paddingRight="15" paddingLeft="15"
    borderThickness="1" borderStyle="solid" borderColor="#838383"
  >
    <mx:VBox 
      width="100%" height="100%" 
      id="videoFrameContainer" 
      horizontalAlign="center"
    >
    </mx:VBox>
    <mx:Label 
      id="sourceLabel" 
      text="{_currentSource.name}" 
      width="100%" 
      color="black"
      textAlign="center" 
    />
  </mx:VBox>
</mx:Box>

It was this code that brought me to the idea that I should replace the pixels with percentages, alas without success.正是这段代码让我想到我应该用百分比替换像素,可惜没有成功。

First thing you need to use :(colon) to separate property and value in CSS but you used = (equal to).首先,您需要使用:(colon)来分隔CSS属性和值,但您使用了 =(等于)。 So change it.所以改变它。

Use below styles to display full video in a frame .使用以下styles在一frame显示完整video

style.css样式文件

.video {    
      height: 100%;
      width: 100%;   
    } 

demo.html演示.html

<iframe src="video1.mp4" class="video" /> 

(See update at bottom) (见底部更新)

The example given isn't valid CSS:给出的示例不是有效的 CSS:

  1. Property and value should be separated by a : instead of a =属性和值应该用:而不是=分隔
  2. Rules (property-value pair) should be separated by a ;规则(属性值对)应该用;分隔; instead of a ,而不是一个,
  3. Values shouldn't be wrapped in ' or " . They can simply be left alone值不应包含在'" 。它们可以单独放置

An important thing to remember is that you can't just pass integers as pixel distances;需要记住的重要一点是,您不能仅将整数作为像素距离传递; you need to specify the unit, like this for example: 120px .您需要指定单位,例如: 120px

A second thing is that I'm assuming video is the class name;第二件事是我假设video是班级名称; if it's the tag name the it should be video and not .video .如果是标签名称,则它应该是video而不是.video

Summary:概括:

.video /* or 'video' */ {
  height : 100%;
  width : 100%;
}

I don't know if this is causing the problems, because you haven't given us any of the other code.我不知道这是否是导致问题的原因,因为您没有给我们任何其他代码。 If the rest of the CSS is formatted like this as well that shouldn't work either.如果 CSS 的其余部分也是这样格式化的,那也不应该起作用。 And I don't know jsp, but if that works with regular CSS, this shouldn't work.而且我不知道 jsp,但如果它适用于常规 CSS,则不应该起作用。

Update:更新:

Sorry for the late update, I didn't notice you updated the question until now.抱歉更新晚了,直到现在我才注意到您更新了问题。 As I said, I don't know about jsp and any of the other code;正如我所说,我不了解 jsp 和任何其他代码; I went here for the CSS.我来这里是为了 CSS。 I'm sorry I can't help you anymore.对不起,我不能再帮助你了。 The only CSS with a mistake I can fix is z-index:5" , which should be z-index:5; (or without a ; ), but this is probably just a typo and I'm not even sure if it's relevant.我可以修复的唯一有错误的 CSS 是z-index:5" ,它应该是z-index:5; (或没有; ),但这可能只是一个错字,我什至不确定它是否相关.

I think it's better for the understanding of other people to not delete this answer, but I don't think this has any other value anymore.我认为最好不要删除这个答案,让其他人的理解更好,但我认为这不再有任何其他价值。

使用以下代码显示全屏视频

<iframe src="URL here" style="border: 0; position:fixed; top:0; left:0; right:0; bottom:0; width:100%; height:100%">

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM