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
|
||||
android:name=".Player.VlcPlayerActivity"
|
||||
android:exported="false"
|
||||
android:screenOrientation="landscape"
|
||||
android:theme="@style/Theme.AppCompat.NoActionBar" />
|
||||
|
||||
<meta-data
|
||||
|
@ -11,18 +11,23 @@ import com.lzy.okgo.model.Response;
|
||||
import org.sifacai.vlcjellyfin.Utils.JfClient;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.net.URLEncoder;
|
||||
|
||||
public class Controller {
|
||||
|
||||
public static String TAG = "DLNA控制";
|
||||
|
||||
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\"?>" +
|
||||
"<s:Envelope s:encodingStyle=\"http://schemas.xmlsoap.org/soap/encoding/\" xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">" +
|
||||
"<s:Body>" +
|
||||
"<u:SetAVTransportURI xmlns:u=\"urn:schemas-upnp-org:service:AVTransport:1\">" +
|
||||
"<InstanceID>0</InstanceID>" +
|
||||
"<CurrentURI><![CDATA[" + url + "]]></CurrentURI>" +
|
||||
//"<CurrentURI><![CDATA[" + url + "]]></CurrentURI>" +
|
||||
"<CurrentURI>" + url + "</CurrentURI>" +
|
||||
"<CurrentURIMetaData></CurrentURIMetaData>" +
|
||||
"</u:SetAVTransportURI>" +
|
||||
"</s:Body></s:Envelope>";
|
||||
|
@ -202,6 +202,7 @@ public class DlnaActivity extends BaseActivity {
|
||||
};
|
||||
|
||||
public void ProgressNOTIFY(String data) throws IOException, XmlPullParserException {
|
||||
//Log.d(TAG, "ProgressNOTIFY: " + data);
|
||||
if(data.startsWith("M-SEARCH")) return;
|
||||
HashMap<String,String> dh = DlnaDevice.parseNOTIFY(data);
|
||||
boolean isav = DlnaDevice.isMediaRenderer(dh.get("NT"));
|
||||
|
@ -18,6 +18,7 @@ public class DlnaDevice {
|
||||
if(nt == null) return false;
|
||||
if(nt.equals("upnp:rootdevice")) return true;
|
||||
if(nt.indexOf("device:MediaRenderer") >= 0) return true;
|
||||
if(nt.indexOf("service:AVTransport") >= 0) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -7,6 +7,7 @@ import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.util.Log;
|
||||
import android.view.KeyEvent;
|
||||
import android.view.MotionEvent;
|
||||
import android.view.View;
|
||||
import android.widget.FrameLayout;
|
||||
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) {
|
||||
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.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.setOnClickListener(new View.OnClickListener() {
|
||||
@Override
|
||||
|
@ -617,7 +617,7 @@ public class JfClient {
|
||||
@Override
|
||||
public void onError(Response<String> response) {
|
||||
if (errcb != null) {
|
||||
errcb.onError(response.toString());
|
||||
errcb.onError(response.message());
|
||||
}
|
||||
}
|
||||
});
|
||||
@ -649,7 +649,7 @@ public class JfClient {
|
||||
@Override
|
||||
public void onError(Response<String> response) {
|
||||
if (errcb != null) {
|
||||
errcb.onError(response.body());
|
||||
errcb.onError(response.message());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -20,7 +20,7 @@
|
||||
android:id="@+id/actionBar_banner"
|
||||
android:layout_width="100dp"
|
||||
android:layout_height="match_parent"
|
||||
android:scaleType="fitXY"
|
||||
android:scaleType="fitCenter"
|
||||
app:srcCompat="@drawable/banner" />
|
||||
|
||||
<TextView
|
||||
|
Loading…
Reference in New Issue
Block a user