mirror of
https://github.com/sifacaii/VlcJellyfin
synced 2025-05-26 06:20:20 -04:00
界面优化
This commit is contained in:
parent
8b4c6fe468
commit
6365a14806
@ -47,6 +47,7 @@
|
|||||||
<activity
|
<activity
|
||||||
android:name=".Player.VlcPlayerActivity"
|
android:name=".Player.VlcPlayerActivity"
|
||||||
android:exported="false"
|
android:exported="false"
|
||||||
|
android:screenOrientation="landscape"
|
||||||
android:theme="@style/Theme.AppCompat.NoActionBar" />
|
android:theme="@style/Theme.AppCompat.NoActionBar" />
|
||||||
|
|
||||||
<meta-data
|
<meta-data
|
||||||
|
@ -11,18 +11,23 @@ import com.lzy.okgo.model.Response;
|
|||||||
import org.sifacai.vlcjellyfin.Utils.JfClient;
|
import org.sifacai.vlcjellyfin.Utils.JfClient;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.io.UnsupportedEncodingException;
|
||||||
|
import java.net.URLEncoder;
|
||||||
|
|
||||||
public class Controller {
|
public class Controller {
|
||||||
|
|
||||||
public static String TAG = "DLNA控制";
|
public static String TAG = "DLNA控制";
|
||||||
|
|
||||||
public static void SetAVTransportURI(String controlUrl, String url, JfClient.JJCallBack cb) {
|
public static void SetAVTransportURI(String controlUrl, String url, JfClient.JJCallBack cb) {
|
||||||
|
url = url.substring(0,url.indexOf("stream.mp4")) + "stream.mp4";
|
||||||
|
//Log.d(TAG, "SetAVTransportURI: " + url);
|
||||||
String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
String xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
|
||||||
"<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
|
"<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
|
||||||
"<s:Body>" +
|
"<s:Body>" +
|
||||||
"<u:SetAVTransportURI xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\">" +
|
"<u:SetAVTransportURI xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\">" +
|
||||||
"<InstanceID>0</InstanceID>" +
|
"<InstanceID>0</InstanceID>" +
|
||||||
"<CurrentURI><![CDATA[" + url + "]]></CurrentURI>" +
|
//"<CurrentURI><![CDATA[" + url + "]]></CurrentURI>" +
|
||||||
|
"<CurrentURI>" + url + "</CurrentURI>" +
|
||||||
"<CurrentURIMetaData></CurrentURIMetaData>" +
|
"<CurrentURIMetaData></CurrentURIMetaData>" +
|
||||||
"</u:SetAVTransportURI>" +
|
"</u:SetAVTransportURI>" +
|
||||||
"</s:Body></s:Envelope>";
|
"</s:Body></s:Envelope>";
|
||||||
|
@ -202,6 +202,7 @@ public class DlnaActivity extends BaseActivity {
|
|||||||
};
|
};
|
||||||
|
|
||||||
public void ProgressNOTIFY(String data) throws IOException, XmlPullParserException {
|
public void ProgressNOTIFY(String data) throws IOException, XmlPullParserException {
|
||||||
|
//Log.d(TAG, "ProgressNOTIFY: " + data);
|
||||||
if(data.startsWith("M-SEARCH")) return;
|
if(data.startsWith("M-SEARCH")) return;
|
||||||
HashMap<String,String> dh = DlnaDevice.parseNOTIFY(data);
|
HashMap<String,String> dh = DlnaDevice.parseNOTIFY(data);
|
||||||
boolean isav = DlnaDevice.isMediaRenderer(dh.get("NT"));
|
boolean isav = DlnaDevice.isMediaRenderer(dh.get("NT"));
|
||||||
|
@ -18,6 +18,7 @@ public class DlnaDevice {
|
|||||||
if(nt == null) return false;
|
if(nt == null) return false;
|
||||||
if(nt.equals("upnp:rootdevice")) return true;
|
if(nt.equals("upnp:rootdevice")) return true;
|
||||||
if(nt.indexOf("device:MediaRenderer") >= 0) return true;
|
if(nt.indexOf("device:MediaRenderer") >= 0) return true;
|
||||||
|
if(nt.indexOf("service:AVTransport") >= 0) return true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7,6 +7,7 @@ import android.os.Handler;
|
|||||||
import android.os.Looper;
|
import android.os.Looper;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.KeyEvent;
|
import android.view.KeyEvent;
|
||||||
|
import android.view.MotionEvent;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.widget.FrameLayout;
|
import android.widget.FrameLayout;
|
||||||
import android.widget.ImageView;
|
import android.widget.ImageView;
|
||||||
@ -548,6 +549,13 @@ public class VlcPlayerActivity extends BaseActivity implements MediaPlayer.Event
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onTouchEvent(MotionEvent event) {
|
||||||
|
//return super.onTouchEvent(event);
|
||||||
|
Show();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
private void ReportPlayState(JfClient.ReportType type) {
|
private void ReportPlayState(JfClient.ReportType type) {
|
||||||
JfClient.ReportPlayBackState(type,currItem.Id,currItem.PositionTicks);
|
JfClient.ReportPlayBackState(type,currItem.Id,currItem.PositionTicks);
|
||||||
}
|
}
|
||||||
|
@ -39,6 +39,10 @@ public class BaseActivity extends AppCompatActivity implements CustomAdapt {
|
|||||||
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
actionBar.setDisplayOptions(ActionBar.DISPLAY_SHOW_CUSTOM);
|
||||||
actionBar.setCustomView(R.layout.activebar_custom);
|
actionBar.setCustomView(R.layout.activebar_custom);
|
||||||
|
|
||||||
|
if(getResources().getConfiguration().orientation == Configuration.ORIENTATION_PORTRAIT){
|
||||||
|
findViewById(R.id.actionBar_banner).setVisibility(View.GONE);
|
||||||
|
}
|
||||||
|
|
||||||
activeBarBack = findViewById(R.id.actionBar_back);
|
activeBarBack = findViewById(R.id.actionBar_back);
|
||||||
activeBarBack.setOnClickListener(new View.OnClickListener() {
|
activeBarBack.setOnClickListener(new View.OnClickListener() {
|
||||||
@Override
|
@Override
|
||||||
|
@ -617,7 +617,7 @@ public class JfClient {
|
|||||||
@Override
|
@Override
|
||||||
public void onError(Response<String> response) {
|
public void onError(Response<String> response) {
|
||||||
if (errcb != null) {
|
if (errcb != null) {
|
||||||
errcb.onError(response.toString());
|
errcb.onError(response.message());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
@ -649,7 +649,7 @@ public class JfClient {
|
|||||||
@Override
|
@Override
|
||||||
public void onError(Response<String> response) {
|
public void onError(Response<String> response) {
|
||||||
if (errcb != null) {
|
if (errcb != null) {
|
||||||
errcb.onError(response.body());
|
errcb.onError(response.message());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -20,7 +20,7 @@
|
|||||||
android:id="@+id/actionBar_banner"
|
android:id="@+id/actionBar_banner"
|
||||||
android:layout_width="100dp"
|
android:layout_width="100dp"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:scaleType="fitXY"
|
android:scaleType="fitCenter"
|
||||||
app:srcCompat="@drawable/banner" />
|
app:srcCompat="@drawable/banner" />
|
||||||
|
|
||||||
<TextView
|
<TextView
|
||||||
|
Loading…
Reference in New Issue
Block a user