我正在使用Video.js播放器从我的本地网络摄像头流式传输实时内容(但我认为在这种情况下无关紧要,它可能是来自网络的任何直播流).我写了一个非常简单的代码:
<head>
<link href="video-js.css" rel="stylesheet">
<script src="http://www.andy-howard.com/js/libs/jquery-1.8.2.min.js"></script>
<script src="http://vjs.zencdn.net/c/video.js"></script>
<link href="http://vjs.zencdn.net/c/video-js.css" rel="stylesheet">
</style>
</head>
<body>
<video id="video1" class="video-js vjs-default-skin" width="640" height="480" controls="controls"
preload="auto" data-setup='{}' autoplay="true" >
<source src="http://10.172.180.31:8090/live.flv" type="video/x-flv">
</video>
</body>
Run Code Online (Sandbox Code Playgroud)
现在在该配置中我看到了流内容,但是有几个错误:
1)我没有看到控件(暂停流)
2)Stream看起来像这样,因此视频不会调整为组件的完整大小.但是,当我调整网页上的元素大小(例如,通过控制和滚动鼠标滚轮在Chrome中)到110%,然后视频填充整个组件时,这非常有趣.看起来像video.js中的错误或者我的实现可能是错误的?
3)当我删除参数时autoplay="true"- 没有任何显示,控件和视频消失,无法播放.
4)我想删除autoplay="true",但添加海报信息包括poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/NYC_Times_Square_wide_angle.jpg/640px-NYC_Times_Square_wide_angle.jpg"- 没有任何改变,流不可见,控件不在那里.
5)当我删除data-setup参数并保持这样:
<video id="video1" class="video-js vjs-default-skin" width="640" height="480" controls="controls"
preload="auto" poster="http://upload.wikimedia.org/wikipedia/commons/thumb/4/41/NYC_Times_Square_wide_angle.jpg/640px-NYC_Times_Square_wide_angle.jpg" >然后控件和海报是可见的(这很棒!),但播放按钮是灰色的,不可能播放我的流.
我希望达到这样的效果:在加载网页后,我可以看到带有播放按钮的海报图像,当我点击它时 - 我将看到正确调整大小的流.我错过了什么?谢谢!
我正在使用moment.js在我的网页上显示时间.我有html div:
<div id="time"></div>
Run Code Online (Sandbox Code Playgroud)
和以下javascript:
<script>
moment.tz.add('America/New_York|EST EDT|50 40|0101|1Lz50 1zb0 Op0');
var newYork = moment.tz("America/New_York").format('HH:mm a');
$('#time').append( "Current time in New York: "+newYork );
</script>
Run Code Online (Sandbox Code Playgroud)
当我运行页面时,它给了我正确的时间,但它不会随着每分钟而改变,所以即使在10分钟左右之后我也会得到加载页面时可见的时间.有没有办法让时间更新?到目前为止,这是我的小提琴:http://jsfiddle.net/93pEd/132/
我有以下页面http://jsfiddle.net/Leytgm3L/18/,你可以看到有6个链接到不同的城市.我提出了以下css:
.cities-main li {
float: none;
display: inline-block;
text-align: center;
margin-right: 10%;
list-style: none;
text-transform: uppercase;
font-weight: 400;
font-size: 18px;
}
Run Code Online (Sandbox Code Playgroud)
水平传播这个列表,但问题是它不是主要内部的中心......我怎么能这样做?
我在表单中有两个日期:
var date = Wed Oct 07 2015 19:48:08 GMT+0200 (Central European Daylight Time);
var dateOne = new Date(date);
var dateTwo = new Date();
if (dateOne == dateTwo )
alert ("equals");
else{
alert("not equal");
}
Run Code Online (Sandbox Code Playgroud)
即使我在客户的网站上设置日期,Wed Oct 07 2015 19:48:08 GMT+0200 (Central European Daylight Time)我仍然会得到not equal ...
即使我这样做:
var data1 = new Date();
var data2 = new Date();
if (data1 == data2)
alert ("equals");
else{
alert("not equal");
}
Run Code Online (Sandbox Code Playgroud)
将not equal再次出现.我究竟做错了什么?
我正在CSS中创建一个非常简单的菜单.目前我有html代码:
<div id="header">
<ul id="navlist">
<li id="active"><a href="#" id="current">Item one</a></li>
<li><a href="#">Item two</a></li>
<li><a href="#">Item three</a></li>
<li><a href="#">Item four</a></li>
<li><a href="#">Item five</a></li>
</ul>
</div>
Run Code Online (Sandbox Code Playgroud)
和我的css:
#navlist li
{
display: inline;
list-style-type: none;
padding-right: 20px;
}
#header{
position:fixed;
height: 20px;
display:block;
width: 100%;
background: rgba(0, 0, 0, 0.5);
z-index:9;
text-align:center;
color: #f2f2f2;
padding: 4px 0 0 0;
}
#header{
top:0px;
}
Run Code Online (Sandbox Code Playgroud)
这是我的代码的jsfiddle,你可以看到项目低于实际的暗条 - 我怎么能改变它?谢谢.
我有以下CSS代码:
#section1{
background-color: red;
height: 600px;
}
#section2{
background-color: blue;
height: 700px;
}
#section3{
background-color: orange;
height: 300px;
position:relative;
}
#footer{
bottom:0px;
}
#footer {
position:fixed;
display:block;
width: 100%;
background: rgba(0, 0, 0, 0.5);
z-index:9;
text-align:center;
color: #f2f2f2;
padding: 4px 0 4px 0;
}
#betterFooter {
position:absolute;
bottom: 0px;
display:block;
width: 100%;
background: rgba(0, 0, 0, 0.5);
z-index:9;
text-align:center;
color: #f2f2f2;
padding: 4px 0 4px 0;
}
Run Code Online (Sandbox Code Playgroud)
并且由于它,当我向上/向下滚动时,我的页面上始终显示页脚.我想要实现的是在页面的最底部显示另一个具有不同文本的页脚,因此当用户向下滚动并输入#section3时,正常的页脚将消失,他将只看到新的页脚.我以为我可以使用CSS属性:
#section3 #footer{
display:none;
}
Run Code Online (Sandbox Code Playgroud)
但似乎它没有解决我的情况.完整的html和css代码附在我的小提琴中.谢谢!
我有以下结构:
class MyClass {
String name;
String descr;
public String getName() {
return name;
}
}
Run Code Online (Sandbox Code Playgroud)
现在我有一个这些对象的列表,如果列表包含任何这些元素,我想从上面的对象打印名称.
到目前为止这是我的代码:
List<MyClass> list = getList();
if (list != null && list.size() > 0) {
System.out.println(list.get(0).getName());
} else {
System.out.println("list is empty");
}
Run Code Online (Sandbox Code Playgroud)
当list只包含一个元素时,这将起作用.现在我需要改进它并考虑一个例子,当有多个元素时 - 在这种情况下我需要打印所有名称,逗号分隔.
例如,输出应该是:
当有3个元素时:
name1,name2,name3
Run Code Online (Sandbox Code Playgroud)
当有一个元素时:
name1
Run Code Online (Sandbox Code Playgroud)
什么时候没有:
list is empty
Run Code Online (Sandbox Code Playgroud)
什么是最有效的实施方式?
我有以下页面http://jsfiddle.net/Leytgm3L/20/,并且有一个白色正方形,将来会链接到下面的区域-当用户开始向下滚动时,该如何做才能使该图标消失?到目前为止,此箭头的css如下所示:
.next-section {
width:60px;
height:60px;
background-color:white;
background-image:url(../img/next_section.png);
background-size: 34px 18px;
background-repeat:no-repeat;
background-position:13px 21px;
position:absolute;
bottom:0px;
left:50%;
margin-left:-30px;
opacity:0.9;
}
Run Code Online (Sandbox Code Playgroud)
我只是不确定我是否只能在CSS中执行此操作,还是应该在此处使用一些jquery(而且-我在这里不知道如何执行操作)...谢谢
我执行本教程中取出过程中谷歌标志https://developers.google.com/identity/sign-in/ios/sign-in?configured=true&ver=swift
正如我在那里看到的那样,作者写道:
在这些示例中,视图控制器是UIViewController的子类.如果在你的项目,实现GIDSignInUIDelegate该类不是的UIViewController的子类,实现signInWillDispatch:错误:,签到:presentViewController:和签到:dismissViewController:在GIDSignInUIDelegate协议的方法.
所以按照他的建议我写了如下:
import UIKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, GIDSignInDelegate {
func application(application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
// Initialize sign-in
var configureError: NSError?
GGLContext.sharedInstance().configureWithError(&configureError)
assert(configureError == nil, "Error configuring Google services: \(configureError)")
GIDSignIn.sharedInstance().delegate = self
return true
}
// [START openurl]
func application(application: UIApplication,
openURL url: NSURL, sourceApplication: String?, annotation: AnyObject) -> Bool {
return GIDSignIn.sharedInstance().handleURL(url,
sourceApplication: sourceApplication,
annotation: annotation)
}
// [END openurl]
@available(iOS 9.0, *)
func application(app: UIApplication, openURL url: NSURL, …Run Code Online (Sandbox Code Playgroud) 在我的 jcr 节点中,我有密钥subpage并且它保存了 type 的值String[]:
{"title":"some title1", "url":"some url1"}
{"title":"some title2", "url":"some url2"}
{"title":"some title3", "url":"some url3"}
{"title":"some title4", "url":"some url4"}
Run Code Online (Sandbox Code Playgroud)
我如何在java中访问它?
我试过:
ValueMap contentValueMap = resource.getValueMap();
String subpages = contentValueMap.get("subpage", String.class);
System.out.println(subpages);
Run Code Online (Sandbox Code Playgroud)
但它只打印第一个字符串:
{"title":"some title1", "url":"some url1"}
Run Code Online (Sandbox Code Playgroud)
我怎样才能联系到他们中的其他人?