Skip to content

Commit b9d7f71

Browse files
authored
Merge pull request #34 from ksvc/v2.2.6
update to v2.2.6
2 parents b9c27ac + 59f2545 commit b9d7f71

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+2642
-1996
lines changed

KSYLiveDemo/app/src/main/AndroidManifest.xml

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@
3333
android:icon="@mipmap/ic_launcher"
3434
android:label="@string/app_name"
3535
android:supportsRtl="true"
36-
android:theme="@style/AppTheme">
36+
android:theme="@style/AppTheme"
37+
android:name="com.ksyun.media.streamer.demo.DemoApplication">
3738

3839
<activity android:name="com.ksyun.live.demo.MainActivity">
3940
<intent-filter>
@@ -43,6 +44,11 @@
4344
</intent-filter>
4445
</activity>
4546

47+
<activity android:name=".player.activity.TextureVodActivity"
48+
android:screenOrientation="landscape"
49+
android:configChanges="orientation|keyboardHidden|screenSize"
50+
android:launchMode="singleTop"></activity>
51+
4652
<activity
4753
android:name="com.ksyun.live.demo.player.activity.TextureVideoActivity"
4854
android:configChanges="orientation|keyboardHidden|screenSize"
@@ -52,14 +58,6 @@
5258
android:theme="@android:style/Theme.NoTitleBar.Fullscreen"
5359
android:configChanges="orientation|keyboardHidden|screenSize"
5460
/>
55-
<activity
56-
android:name="com.ksyun.live.demo.player.activity.SurfaceActivity"
57-
android:configChanges="orientation|keyboardHidden|screenSize"
58-
android:launchMode="singleTop" />
59-
<activity
60-
android:name="com.ksyun.live.demo.player.activity.KSYSurfaceActivity"
61-
android:configChanges="orientation|keyboardHidden|screenSize"
62-
android:launchMode="singleTop" />
6361

6462
<activity android:name=".player.activity.PlayerActivity" ></activity>
6563
<activity android:name="com.ksyun.live.demo.player.activity.NetMediaActivty" ></activity>

KSYLiveDemo/app/src/main/java/com/ksyun/live/demo/player/activity/HistoryActivity.java

Lines changed: 18 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
/**
2121
* Created by liubohua on 16/7/20.
2222
*/
23-
public class HistoryActivity extends Activity{
23+
public class HistoryActivity extends Activity {
2424
private ListView hislist;
2525
private ArrayList<String> listurl;
2626
private Cursor cursor;
@@ -31,6 +31,10 @@ public class HistoryActivity extends Activity{
3131
@Override
3232
protected void onCreate(Bundle savedInstanceState) {
3333
super.onCreate(savedInstanceState);
34+
//
35+
settings = getSharedPreferences("SETTINGS", Context.MODE_PRIVATE);
36+
// SkinChangeUtil.changeSkin(this,settings.getString("choose_skin", "信息为空"));
37+
3438
setContentView(R.layout.activity_history);
3539
listurl = new ArrayList<String>();
3640

@@ -39,45 +43,30 @@ protected void onCreate(Bundle savedInstanceState) {
3943
NetDb.open();
4044
cursor = NetDb.getAllData();
4145
cursor.moveToFirst();
42-
if(cursor.getCount()>0){
43-
listurl.add( cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
46+
if (cursor.getCount() > 0) {
47+
listurl.add(cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
4448
}
45-
while(cursor.moveToNext()){
46-
listurl.add( cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
49+
while (cursor.moveToNext()) {
50+
listurl.add(cursor.getString(cursor.getColumnIndex(NetDbAdapter.KEY_PATH)));
4751
}
4852

49-
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_expandable_list_item_1,listurl);
53+
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_expandable_list_item_1, listurl);
5054
hislist.setAdapter(adapter);
5155
hislist.setOnItemClickListener(new AdapterView.OnItemClickListener() {
5256
@Override
5357
public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
5458
String path = listurl.get(i);
55-
56-
String chooseview;
57-
settings = getSharedPreferences("SETTINGS", Context.MODE_PRIVATE);
58-
chooseview = settings.getString("choose_view","undefind");
59-
60-
if(chooseview.equals(Settings.USEKSYTEXTURE)){
61-
Intent intent = new Intent(HistoryActivity.this,TextureVideoActivity.class);
62-
intent.putExtra("path",path);
63-
startActivity(intent);
64-
65-
}
66-
else if (chooseview.equals(Settings.USEKGLRENDER)){
67-
Intent intent = new Intent(HistoryActivity.this,TextureViewMediaActivity.class);
68-
intent.putExtra("path",path);
59+
String playerType = settings.getString("choose_type", Settings.LIVE);
60+
if (playerType.equals(Settings.VOD)) {
61+
Intent intent = new Intent(HistoryActivity.this, TextureVodActivity.class);
62+
intent.putExtra("path", path);
6963
startActivity(intent);
70-
}
71-
else if (chooseview.equals(Settings.USEKSYVIVEW)){
72-
Intent intent = new Intent(HistoryActivity.this,KSYSurfaceActivity.class);
73-
intent.putExtra("path",path);
74-
startActivity(intent);
75-
}
76-
else{
77-
Intent intent = new Intent(HistoryActivity.this,SurfaceActivity.class);
78-
intent.putExtra("path",path);
64+
} else {
65+
Intent intent = new Intent(HistoryActivity.this, TextureVideoActivity.class);
66+
intent.putExtra("path", path);
7967
startActivity(intent);
8068
}
69+
8170
}
8271
});
8372

KSYLiveDemo/app/src/main/java/com/ksyun/live/demo/player/activity/JieVideoListViewAdapter.java

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,11 @@
88
import android.widget.ImageView;
99
import android.widget.TextView;
1010

11-
import com.ksyun.live.demo.player.model.MyVideoThumbLoader;
1211
import com.ksyun.live.demo.R;
12+
import com.ksyun.live.demo.player.model.MyVideoThumbLoader;
1313
import com.ksyun.live.demo.player.util.Video;
1414

15+
import java.io.File;
1516
import java.util.ArrayList;
1617
import java.util.List;
1718

@@ -61,9 +62,14 @@ public View getView(int i, View view, ViewGroup viewGroup) {
6162
holder = (ViewHolder)view.getTag();
6263
}
6364
String path = listVideos.get(i).getPath();
64-
holder.img.setTag(path);
65-
mVideoThumbLoader.showThumbByAsyncTask(path, holder.img);
6665

66+
File file = new File(path);
67+
if(file.isDirectory()){
68+
holder.img.setImageResource(R.drawable.file);
69+
}else{
70+
holder.img.setTag(path);
71+
mVideoThumbLoader.showThumbByAsyncTask(path, holder.img);
72+
}
6773
holder.title.setText(listVideos.get(i).getTitle());
6874
holder.path.setText(listVideos.get(i).getPath());
6975
return view;

0 commit comments

Comments
 (0)