diff --git a/sql/mysql.sql b/sql/mysql.sql
index 7b5d943a..8c6c7b0b 100644
--- a/sql/mysql.sql
+++ b/sql/mysql.sql
@@ -48,6 +48,7 @@ CREATE TABLE `device` (
`ssrcCheck` int DEFAULT '0',
`geoCoordSys` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`treeType` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
+ `mediaServerId` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 'auto',
PRIMARY KEY (`id`),
UNIQUE KEY `device_deviceId_uindex` (`deviceId`)
) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
index c57ee175..9ce76ae0 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/PlayServiceImpl.java
@@ -407,7 +407,7 @@ public class PlayServiceImpl implements IPlayService {
}
String mediaServerId = device.getMediaServerId();
MediaServerItem mediaServerItem;
- if (mediaServerId == null) {
+ if (mediaServerId == null || "".equals(device.getMediaServerId()) || "auto".equals(device.getMediaServerId())) {
mediaServerItem = mediaServerService.getMediaServerForMinimumLoad();
} else {
mediaServerItem = mediaServerService.getOne(mediaServerId);
diff --git a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
index aa197efa..db527e28 100644
--- a/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
+++ b/src/main/java/com/genersoft/iot/vmp/service/impl/StreamProxyServiceImpl.java
@@ -98,7 +98,7 @@ public class StreamProxyServiceImpl implements IStreamProxyService {
@Override
public StreamInfo save(StreamProxyItem param) {
MediaServerItem mediaInfo;
- if (param.getMediaServerId() == null || "auto".equals(param.getMediaServerId())){
+ if (param.getMediaServerId() == null || "".equals(param.getMediaServerId()) || "auto".equals(param.getMediaServerId())){
mediaInfo = mediaServerService.getMediaServerForMinimumLoad();
}else {
mediaInfo = mediaServerService.getOne(param.getMediaServerId());
diff --git a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
index 7e8dd3c6..3f3301f6 100644
--- a/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
+++ b/src/main/java/com/genersoft/iot/vmp/storager/dao/DeviceMapper.java
@@ -93,6 +93,7 @@ public interface DeviceMapper {
", ssrcCheck=${ssrcCheck}" +
", geoCoordSys=#{geoCoordSys}" +
", treeType=#{treeType}" +
+ ", mediaServerId=#{mediaServerId}" +
"WHERE deviceId='${deviceId}'"+
" "})
int update(Device device);
diff --git a/web_src/src/components/dialog/deviceEdit.vue b/web_src/src/components/dialog/deviceEdit.vue
index 12c0aa18..49322eb7 100644
--- a/web_src/src/components/dialog/deviceEdit.vue
+++ b/web_src/src/components/dialog/deviceEdit.vue
@@ -18,17 +18,17 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+