本文整理了Java中fr.bmartel.youtubetv.YoutubeTvView
类的一些代码示例,展示了YoutubeTvView
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。YoutubeTvView
类的具体详情如下:
包路径:fr.bmartel.youtubetv.YoutubeTvView
类名称:YoutubeTvView
[英]Youtube TV custom view.
[中]Youtube电视自定义视图。
代码示例来源:origin: bertrandmartel/youtubetv
public void closePlayer() {
youtubeTvView.closePlayer();
}
}
代码示例来源:origin: bertrandmartel/youtubetv
@Override
public void onClick(View view) {
mYoutubeView1.start();
}
});
代码示例来源:origin: bertrandmartel/youtubetv
/**
* Initialize Webview.
*/
private void initView() {
inflate(getContext(), R.layout.youtube_view, this);
init();
}
代码示例来源:origin: bertrandmartel/youtubetv
if (mYoutubeTvView.isShowingNowPlayingCard()) {
break;
case ENDED:
if (mYoutubeTvView.getPlaylistIndex() != -1) {
mYoutubeTvView.start();
updateMediaSession(videoId, rebuildMedia, playbackState, position, speed, title, mYoutubeTvView.getMediaSession());
代码示例来源:origin: bertrandmartel/youtubetv
setBorder();
mWebView = (WebView) findViewById(R.id.youtube_view);
ImageView playIcon = (ImageView) findViewById(R.id.play_icon);
ProgressBar loadingProgress = (ProgressBar) findViewById(R.id.progress_bar);
Handler handler = new Handler();
int width = getMeasuredWidth();
int height = getMeasuredHeight();
mMediaSession.release();
mMediaSession = new MediaSession(getContext(), MEDIA_SESSION_TAG);
mMediaSession.setCallback(new MediaSession.Callback() {
@Override
代码示例来源:origin: bertrandmartel/youtubetv
/**
* This must be override to get actual width & height of the webview and pass it to Javascript to resize player & viewport.
*
* @param hasFocus
*/
@Override
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
int viewWidth = getWidth();
int viewHeight = getHeight();
if (mJavascriptInterface != null && mJavascriptInterface.isPageLoaded()) {
WebviewUtils.callJavaScript(mWebView, "setSize", viewWidth, viewHeight);
} else {
mJavascriptInterface.setSizeOnLoad(viewWidth, viewHeight);
}
}
代码示例来源:origin: bertrandmartel/youtubetv
private void setBorder() {
if (mShowBorder) {
FrameLayout layout = (FrameLayout) findViewById(R.id.youtube_frame);
layout.setPadding(mBorderWidth, mBorderWidth, mBorderWidth, mBorderWidth);
layout.setBackground(getResources().getDrawable(R.drawable.webview_selector));
StateListDrawable drawable = (StateListDrawable) layout.getBackground();
DrawableContainer.DrawableContainerState drawableContainerState = (DrawableContainer.DrawableContainerState) drawable.getConstantState();
Drawable[] children = drawableContainerState.getChildren();
GradientDrawable focusedItem = (GradientDrawable) children[0];
focusedItem.setStroke(mBorderWidth, mBorderColor);
}
}
代码示例来源:origin: bertrandmartel/youtubetv
@Override
public boolean isPlaying() {
return getPlayerState() == VideoState.PLAYING ? true : false;
}
代码示例来源:origin: bertrandmartel/youtubetv
mYoutubeView1.addPlayerListener(new IPlayerListener() {
@Override
public void onPlayerReady(final VideoInfo videoInfo) {
代码示例来源:origin: bertrandmartel/youtubetv
@Override
public void onBackPressed() {
super.onBackPressed();
mYoutubeView1.closePlayer();
mYoutubeView2.closePlayer();
finish();
}
代码示例来源:origin: bertrandmartel/youtubetv
@Override
public void onBackPressed() {
super.onBackPressed();
mYoutubeView1.closePlayer();
finish();
}
代码示例来源:origin: bertrandmartel/youtubetv
@Override
public void onBackPressed() {
super.onBackPressed();
mYoutubeView.closePlayer();
finish();
}
代码示例来源:origin: bertrandmartel/youtubetv
@Override
public void onBackPressed() {
super.onBackPressed();
mYoutubeView.closePlayer();
finish();
}
内容来源于网络,如有侵权,请联系作者删除!