This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<meta-data | |
android:name="com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME" | |
android:value="com.google.android.exoplayer2.ext.cast.DefaultCastOptionsProvider" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// To add a Cast button, add the following snippet. | |
// menu.xml | |
<item | |
android:id="@+id/media_route_menu_item" | |
android:title="@string/media_route_menu_title" | |
app:actionProviderClass="android.support.v7.app.MediaRouteActionProvider" | |
app:showAsAction="always" /> | |
// Then override the onCreateOptionMenu() for each of your activities. | |
// MyActivity.java |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// activity_layout.xml | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | |
android:layout_width="match_parent" | |
android:layout_height="wrap_content" | |
android:gravity="center_vertical" | |
android:orientation="horizontal" > | |
<android.support.v7.app.MediaRouteButton | |
android:id="@+id/media_route_button" | |
android:layout_width="wrap_content" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
String videoUrl = "https://github.com/mediaelement/mediaelement-files/blob/master/big_buck_bunny.mp4?raw=true"; | |
MediaMetadata movieMetadata = new MediaMetadata(MediaMetadata.MEDIA_TYPE_MOVIE); | |
movieMetadata.putString(MediaMetadata.KEY_TITLE, "Test Stream"); | |
movieMetadata.putString(MediaMetadata.KEY_ALBUM_ARTIST, "Test Artist"); | |
movieMetadata.addImage(new WebImage(Uri.parse("https://github.com/mkaflowski/HybridMediaPlayer/blob/master/images/cover.jpg?raw=true"))); | |
MediaInfo mediaInfo = new MediaInfo.Builder(videoUrl) | |
.setStreamType(MediaInfo.STREAM_TYPE_BUFFERED) | |
.setContentType(MimeTypes.VIDEO_UNKNOWN) | |
.setMetadata(movieMetadata).build(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final CastPlayer castPlayer = new CastPlayer(castContext); | |
castPlayer.setSessionAvailabilityListener(new CastPlayer.SessionAvailabilityListener() { | |
@Override | |
public void onCastSessionAvailable() { | |
castPlayer.loadItems(mediaItems, 0, time, Player.REPEAT_MODE_OFF); | |
} | |
@Override | |
public void onCastSessionUnavailable() { | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
StackTraceElement[] stackTraceElements = Thread.currentThread().getStackTrace(); | |
StringBuilder sb = new StringBuilder(); | |
for (StackTraceElement stackTraceElement : stackTraceElements) { | |
sb.append(stackTraceElement.getMethodName()).append(" : ").append(stackTraceElement.getLineNumber()).append(" -> "); | |
} | |
KLog.d(sb.toString()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import base64 | |
import hashlib | |
import os | |
import sys | |
import urllib.request | |
from xml.dom import minidom | |
import requests | |