twitter card with playable video stream will be treated as tweet video
This commit is contained in:
parent
167e143f95
commit
1a8526f581
|
@ -259,7 +259,8 @@ public class ParcelableMedia implements Parcelable {
|
|||
@Nullable
|
||||
private static ParcelableMedia[] fromCard(@Nullable CardEntity card, @Nullable UrlEntity[] entities) {
|
||||
if (card == null) return null;
|
||||
if ("animated_gif".equals(card.getName())) {
|
||||
final String name = card.getName();
|
||||
if ("animated_gif".equals(name) || "player".equals(name)) {
|
||||
final BindingValue player_stream_url = card.getBindingValue("player_stream_url");
|
||||
if (!(player_stream_url instanceof StringValue))
|
||||
return null;
|
||||
|
|
|
@ -326,7 +326,6 @@ public final class ContentValuesCreator implements TwidereConstants {
|
|||
values.put(Statuses.STATUS_ID, orig.getId());
|
||||
values.put(Statuses.STATUS_TIMESTAMP, orig.getCreatedAt().getTime());
|
||||
|
||||
|
||||
final Status status;
|
||||
if (orig.isRetweet()) {
|
||||
final Status retweetedStatus = orig.getRetweetedStatus();
|
||||
|
|
|
@ -70,8 +70,16 @@ public class TwitterCardUtils {
|
|||
}
|
||||
|
||||
public static boolean isCardSupported(ParcelableCardEntity card) {
|
||||
if (card == null) return false;
|
||||
return CARD_NAME_PLAYER.equals(card.name) || CARD_NAME_AUDIO.equals(card.name);
|
||||
if (card == null || card.name == null) return false;
|
||||
switch (card.name) {
|
||||
case CARD_NAME_PLAYER: {
|
||||
return ParcelableCardEntity.getValue(card, "player_stream_url") == null;
|
||||
}
|
||||
case CARD_NAME_AUDIO: {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.mariotaku.twidere.util.support;
|
||||
|
||||
import android.annotation.TargetApi;
|
||||
import android.graphics.drawable.Drawable;
|
||||
import android.os.Build;
|
||||
|
||||
|
@ -34,7 +35,7 @@ public class DrawableSupport {
|
|||
DrawableSupportLollipop.getOutline(drawable, outlineCompat);
|
||||
}
|
||||
|
||||
|
||||
@TargetApi(Build.VERSION_CODES.LOLLIPOP)
|
||||
private static class DrawableSupportLollipop {
|
||||
|
||||
public static void getOutline(Drawable drawable, OutlineCompat outlineCompat) {
|
||||
|
|
Loading…
Reference in New Issue