我有一个带有响应式视频的滑块,可以全屏显示。
在全屏模式下点击海报图片时,我想获取图片的m_ButtonOk.setOnClickListener(new OnClickListener() {
@Override
public void onClick(View v) {
String email = m_EditEmail.getText().toString();
String pass = m_EditPassword.getText().toString();
if (email.equals("") == false && pass.equals("") == false) {
//Save user info to Crashlytics
Crashlytics.setUserEmail(email);
showProgressDialog(getResources().getString(R.string.wait), getResources().getString(R.string.logging_on));
Intent logOnIntent = new Intent(v.getContext(), dk.le34.taskassistant.activity.TaskAssistantService.class);
logOnIntent.addCategory("dk.le34.taskassistant.LOG_ON");
logOnIntent.putExtra("EMAIL", email);
logOnIntent.putExtra("PASSWORD", pass);
logOnIntent.putExtra("REMEMBER", m_CheckBoxRemember.isChecked());
startService(logOnIntent);
} else {
Toast.makeText(v.getContext(), getResources().getString(R.string.user_details), Toast.LENGTH_LONG).show();
}
}
});
以设置div (。sp-layer),其中加载了视频的iframe
.clientWidth
事件似乎工作正常,但每当我点击fullscreenchange
事件的链接时,fullScreenMode 未定义?
.on('click')
答案 0 :(得分:1)
在点击处理程序中将this.fullScreenMode
更改为document.fullScreenMode
。在点击处理程序中,this
指的是按钮a.sp-video
,而不是文档。
如:
$('a.sp-video').on('click', function() {
console.log('clicked on link');
console.log('fullScreenMode: ' + document.fullScreenMode);
if (document.fullScreenMode) {...