diff options
author | Andrew Dolgov <[email protected]> | 2015-07-10 09:14:18 +0300 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2015-07-10 09:14:18 +0300 |
commit | 5c0768b40d305f6a93957d8e3426d2ae493a15bf (patch) | |
tree | 88c67134e1b874eb50504d575cdd43072c6770a1 /org.fox.ttrss/src | |
parent | d368ffa6886c2014827db95b02d933589f7a7996 (diff) |
remove inline video player
Diffstat (limited to 'org.fox.ttrss/src')
4 files changed, 47 insertions, 28 deletions
diff --git a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java index dbd74928..1fcdd721 100755 --- a/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java +++ b/org.fox.ttrss/src/main/java/org/fox/ttrss/HeadlinesFragment.java @@ -8,7 +8,6 @@ import android.content.res.Resources.Theme; import android.graphics.Bitmap; import android.graphics.Paint; import android.graphics.drawable.Drawable; -import android.media.MediaPlayer; import android.net.Uri; import android.os.Build; import android.os.Bundle; @@ -29,7 +28,6 @@ import android.view.ContextMenu.ContextMenuInfo; import android.view.Display; import android.view.LayoutInflater; import android.view.MenuItem; -import android.view.MotionEvent; import android.view.View; import android.view.View.OnClickListener; import android.view.ViewGroup; @@ -45,7 +43,6 @@ import android.widget.ImageView; import android.widget.ListView; import android.widget.ProgressBar; import android.widget.TextView; -import android.widget.VideoView; import com.amulyakhare.textdrawable.TextDrawable; import com.amulyakhare.textdrawable.util.ColorGenerator; @@ -657,7 +654,6 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, public ImageView publishedView; public TextView excerptView; public ImageView flavorImageView; - public VideoView flavorVideoView; public ImageView flavorVideoPlayView; public TextView authorView; public TextView dateView; @@ -825,7 +821,6 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, holder.publishedView = (ImageView)v.findViewById(R.id.published); holder.excerptView = (TextView)v.findViewById(R.id.excerpt); holder.flavorImageView = (ImageView) v.findViewById(R.id.flavor_image); - holder.flavorVideoView = (VideoView) v.findViewById(R.id.flavor_video); holder.flavorVideoPlayView = (ImageView) v.findViewById(R.id.flavor_video_play); holder.authorView = (TextView)v.findViewById(R.id.author); holder.dateView = (TextView) v.findViewById(R.id.date); @@ -1031,12 +1026,56 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, holder.flavorImageHolder.setVisibility(View.VISIBLE); holder.flavorImageView.setVisibility(View.VISIBLE); holder.flavorImageLoadingBar.setVisibility(View.VISIBLE); - holder.flavorVideoView.setVisibility(View.GONE); holder.flavorVideoPlayView.setVisibility(View.GONE); boolean videoFound = false; - if (m_prefs.getBoolean("enable_headlines_video", false) && article.articleDoc != null && holder.flavorVideoView != null) { + if (article.articleDoc != null && holder.flavorVideoPlayView != null) { + Element video = article.articleDoc.select("video").first(); + + if (video != null) { + try { + Element source = video.select("source").first(); + + String streamUri = source.attr("src"); + String posterUri = video.attr("poster"); + + if (streamUri != null && posterUri != null) { + + if (!posterUri.equals(holder.flavorImageView.getTag())) { + holder.flavorImageView.setTag(posterUri); + + ImageAware imageAware = new ImageViewAware(holder.flavorImageView, false); + + m_imageLoader.displayImage(posterUri, imageAware, displayImageOptions); + } + + videoFound = true; + + holder.flavorImageLoadingBar.setVisibility(View.GONE); + holder.flavorImageView.setVisibility(View.VISIBLE); + holder.flavorVideoPlayView.setVisibility(View.VISIBLE); + + holder.flavorImageView.setOnClickListener(new OnClickListener() { + @Override + public void onClick(View v) { + + // + } + }); + + // ONCLICK open video player + + } + } catch (Exception e) { + e.printStackTrace(); + videoFound = false; + } + } + + } + + /* if (m_prefs.getBoolean("enable_headlines_video", false) && article.articleDoc != null && holder.flavorVideoView != null) { Element source = article.articleDoc.select("video > source").first(); if (source != null) { @@ -1096,7 +1135,7 @@ public class HeadlinesFragment extends Fragment implements OnItemClickListener, videoFound = false; } } - } + } */ if (!videoFound && showFlavorImage && holder.flavorImageView != null) { holder.flavorImageArrow.setVisibility(View.GONE); diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row.xml b/org.fox.ttrss/src/main/res/layout/headlines_row.xml index b662d61e..cb7dfde1 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row.xml @@ -91,13 +91,6 @@ android:cropToPadding="true" android:visibility="visible" /> - <VideoView - android:id="@+id/flavor_video" - android:layout_width="match_parent" - android:layout_height="200dp" - android:layout_gravity="center" - android:visibility="gone" /> - <ImageView android:id="@+id/flavor_video_play" android:layout_width="64dp" diff --git a/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml b/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml index 5e9307e6..26b02739 100755 --- a/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml +++ b/org.fox.ttrss/src/main/res/layout/headlines_row_unread.xml @@ -93,13 +93,6 @@ android:cropToPadding="true" android:visibility="visible" /> - <VideoView - android:id="@+id/flavor_video" - android:layout_width="match_parent" - android:layout_height="200dp" - android:layout_gravity="center" - android:visibility="gone" /> - <ImageView android:id="@+id/flavor_video_play" android:layout_width="match_parent" diff --git a/org.fox.ttrss/src/main/res/xml/preferences.xml b/org.fox.ttrss/src/main/res/xml/preferences.xml index f29ecbf4..e8fcdcb6 100755 --- a/org.fox.ttrss/src/main/res/xml/preferences.xml +++ b/org.fox.ttrss/src/main/res/xml/preferences.xml @@ -188,12 +188,6 @@ android:defaultValue="false" android:key="transport_debugging" android:title="@string/transport_debugging" /> - <org.fox.ttrss.util.LessBrokenSwitchPreference - android:defaultValue="false" - android:key="enable_headlines_video" - android:title="Inline video player" - android:summary="Enable rudimentary video player in headlines view. Tap to (un)pause." /> - </PreferenceCategory> <Preference |