是否有官方方式隐藏More videosYouTube嵌入的标题和部分(截至2018年7月2日的最新版本),只是在右下方显示YouTube徽标?我知道嵌入曾经有过这种能力.
我基本上寻找的是嵌入式自动播放,除了强制性的YouTube徽标之外没有其他元素,并且可以暂停它,但是More videos在执行此操作时没有出现.
对于该showinfo选项,文档目前说:
将参数值设置为0会导致播放器不显示
before视频开始播放的视频标题和上传者等信息.
所以这before清楚地表明这在视频播放期间没有生效.
但有没有办法隐藏上传器,标题,后观和共享按钮从嵌入的顶部?
这是视频暂停时的当前状态:
<iframe src="https://www.youtube.com/embed/dnmJLVWetQM?autoplay=1&controls=0&modestbranding=1&showinfo=0&iv_load_policy=3" frameborder="0" allowfullscreen="1" allow="autoplay; encrypted-media" title="YouTube video player" width="720" height="405">
Run Code Online (Sandbox Code Playgroud)
此处的评论不再是最新的.
对于该rel选项,文档目前说:
此参数指示播放器在播放初始视频时是否应显示相关视频.
因此,当视频暂停时,这也不适用.
我目前正在尝试使用gapi.auth2Google Sign-In for Websites API,这是我的代码:
- 加载库:
<script src="https://apis.google.com/js/platform.js?onload=onLoadGapiCallback" async defer></script>
- 初始化auth2变量:
var auth2;
window.onLoadGapiCallback = () => {
gapi.load('auth2', () => {
auth2 = gapi.auth2.init({
'client_id': 'CLIENT_ID',
'scope': 'profile email https://www.googleapis.com/auth/youtube.readonly'
});
});
};
Run Code Online (Sandbox Code Playgroud)
- 点击按钮时:
auth2.signIn().then(() => {
console.log('auth is:', auth2.currentUser.get().getAuthResponse().access_token);
});
Run Code Online (Sandbox Code Playgroud)
这很有效,它初始化auth2变量,当我点击按钮时,它会显示SingIn提示,我选择了一个我的Google帐户.问题是从现在开始我必须选择一个YouTube帐户,如果我选择其他帐户而不是主帐户,我会得到一个像这样的异常对象:
{type: "tokenFailed", idpId: "google", error: "USER_LOGGED_OUT"}
Run Code Online (Sandbox Code Playgroud)
还有一个最后发送的XHR请求有这个响应:
{"error":"USER_LOGGED_OUT","detail":"No active session found."}
Run Code Online (Sandbox Code Playgroud)
所以它只适用于我选择主帐户,但我无法选择其他YouTube帐户.
我在这里错过了什么?我查看了所有这些文档,但没有人帮助我:
更新:从运行该代码示例(但与此scope:'profile email https://www.googleapis.com/auth/youtube.readonly')如果让我选择的第一个YouTube帐户每个谷歌账户才会工作.如果我选择任何其他Youtube帐户,我会收到此警报错误:
我试过执行以下代码:
abstract class A {
int met(A a) { return 0;}
int met(B b) { return 1;}
int met(C c) { return 2;}
}
class B extends A {
int met(A a) { return 3;}
int met(B b) { return 4;}
int met(C c) { return 5;}
}
class C extends B {
int fun() {
return ((A) this).met((A) this);
}
}
class Test {
public static void main(String[] args) {
C x = new C();
System.out.println(x.fun());
}
}
Run Code Online (Sandbox Code Playgroud)
输出为"3". …
我现在可以使用Google Knowledge Graph API以何种有用的方式使用它?
假设我有MID 1990 FIFA World Cup,就是这样/m/014nm_
我提出这个要求:
获取https://kgsearch.googleapis.com/v1/entities:search?ids=%2Fm%2F014nm_&key= {MY_API_KEY}
我会得到这样的东西http://pastebin.com/M1fgj7Ew
现在我该如何以有意义的方式使用这些信息?只是描述和维基百科链接并不全面.如何在图表中找出与此相关的其他实体?
如果我在Google上搜索1990 World Cup,我会获得像这样的知识图卡
在这里,我可以清楚地看到有用的信息像Best Player和Goals scored,因此谷歌必须有链接到其他实体1990 FIFA World Cup的知识图.
为了在频道有新视频时收到通知,我已按照此处的建议实施了Pubsubhubbub协议:https://developers.google.com/youtube/v3/guides/push_notifications
我用于callbackUrl的服务器是一个Node.js应用程序,我使用"pubsubhubbub"包来引导创建和处理任何事件.但无论出于何种原因,服务器都不会再收到任何请求.我已经尝试重新订阅YouTube频道,但没有运气.是否有一个到期日期,之后所有订阅都被删除,以便我需要定期重新订阅?任何帮助将非常感谢.
我想拥有一个头像,右边有两个div,与它垂直对齐.
https://jsbin.com/qafiroquve/1/edit?html,css,output
我已经阅读了很多这方面的帖子,但它们似乎都没有帮助我.
将图像放在左边的主要div(header)宽度的30%,以及info70%的div 的最佳方法是什么?
如果其中一个infodiv(name或position)文本太多,我希望infodiv与其左侧的图像垂直对齐.我也希望这个infodiv与图像有一个边距.
我试过这么多的选择:float: left在avatarDIV,display: inline-block两个avatar和info,width: 30% and 40%.我不想为此目的使用bootstrap,因为它使事情变得复杂,我希望尽可能简单.
为了使请求Youtube Data API的youtube.channels.list与mine设定参数true,我必须做出适当的授权请求,即我需要提供绑定到该通道的令牌.
为了获得该令牌,我从这里使用Google客户端库:
<script src="//apis.google.com/js/client:platform.js"></script>
Run Code Online (Sandbox Code Playgroud)
这使我能够代表某个Google帐户发出身份验证请求.
考虑到这一点,我有这个代码:
var parameters = {
'clientid': 'CLIENT_ID',
'scope': 'https://www.googleapis.com/auth/plus.profile.emails.read https://www.googleapis.com/auth/youtube.readonly',
'cookiepolicy': 'single_host_origin',
'include_granted_scopes': true,
'callback': 'googleLogin'
};
gapi.auth.signIn(parameters);
...
window.googleLogin = (authResult) => {
if (authResult[ 'error' ] == 'immediate_failed') return;
if (authResult[ 'status' ][ 'signed_in' ]) {
// make GET request to https://www.googleapis.com/youtube/v3/channels?part=contentDetails&mine=true
// with Authorization header `Bearer ${gapi.auth.getToken().access_token}`
} else {
console.log("singned out");
}
};
Run Code Online (Sandbox Code Playgroud)
现在的问题是,在我选择我的Google帐户之后,让我们说Youtube帐号.2,我得到的结果好像我选择了主要的Youtube帐户.
所以这里的问题是我得到的令牌gapi.auth不以任何方式考虑我选择的Youtube帐户,它总是为主帐户生成令牌(第1号).
google-authentication google-account youtube-data-api gapi google-signin
我有三个数据库模型(来自Django),可以用作构建推荐系统的输入:
userId,username,email等movieId,movieTitle,Topics等userId,movieId和timestamp(当前推荐系统将比在线找到的通常方法更简单一点,因为没有评级得分,只是用户已经保存了某个电影,并且该模型包含了所有内容。电影保存)我仍然应该能够使用矩阵分解(MF)来构建推荐系统,即使某个项目的等级只是1和0(已保存或未保存)的形式。
为了使用所有的MF算法,发现无论是scipy或surprise,我要创建一个pandas数据帧和数据透视这使得所有的用户id将是行(索引)和所有 movieIds将成为列。
用于执行此操作的代码段代码为:
# usersSet and moviesSet contain only ids of users or movies
zeros = numpy.zeros(shape=(len(usersSet), len(moviesSet)), dtype=numpy.int8)
saves_df = pandas.DataFrame(zeros, index=list(usersSet), columns=list(moviesSet))
for save in savesFromDb.iterator(chunk_size=50000):
userId = save['user__id']
movieId = save['movie__id']
saves_df.at[userId, movieId] = 1
Run Code Online (Sandbox Code Playgroud)
到目前为止的问题:
python recommendation-engine scipy pandas matrix-factorization
google-api ×3
youtube-api ×3
gapi ×2
css ×1
fluid-layout ×1
freebase ×1
inheritance ×1
java ×1
overloading ×1
overriding ×1
pandas ×1
python ×1
scipy ×1
websub ×1
youtube ×1