Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
Sailassist
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
54
Merge Requests
54
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
gr-ssv
Sailassist
Commits
7913f764
Commit
7913f764
authored
Oct 03, 2025
by
shigemi miura
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Webブラウザを開いて動画を再生
parent
aad76f2a
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
12 additions
and
33 deletions
+12
-33
MyChatContentView.swift
Seilassist/Sailassist/Chat/View/MyChatContentView.swift
+6
-21
OtherChatContentView.swift
Seilassist/Sailassist/Chat/View/OtherChatContentView.swift
+6
-11
ResGetMessages.swift
Seilassist/Sailassist/Json/ResGetMessages.swift
+0
-1
No files found.
Seilassist/Sailassist/Chat/View/MyChatContentView.swift
View file @
7913f764
...
...
@@ -4,12 +4,10 @@
//
// Created by Mamoru Sugita on 2023/11/08.
//
import
SwiftUI
import
AVKit
struct
MyChatContentView
:
View
{
@State
private
var
isVideoPlayerPresented
=
false
var
message
:
ChatMessage
var
onMediaLoaded
:
(()
->
Void
)?
=
nil
...
...
@@ -22,9 +20,12 @@ struct MyChatContentView: View {
if
msg
.
contains
(
".jpg"
)
||
msg
.
contains
(
".png"
)
{
ChatUrlImageView
(
imageUrl
:
msg
,
onLoad
:
onMediaLoaded
)
.
onTapGesture
{
if
let
videoUrl
=
message
.
videoUrl
,
let
url
=
URL
(
string
:
videoUrl
)
{
isVideoPlayerPresented
=
true
var
urlString
:
String
=
HttpRequestType
.
RawImage
.
rawValue
urlString
=
urlString
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
message
.
shipId
))
urlString
=
urlString
.
replacingOccurrences
(
of
:
"YYYYY"
,
with
:
String
(
message
.
messageId
))
if
let
url
=
URL
(
string
:
urlString
)
{
UIApplication
.
shared
.
open
(
url
)
}
}
}
else
{
...
...
@@ -73,12 +74,6 @@ struct MyChatContentView: View {
}
.
padding
(
.
trailing
,
20
)
}
.
fullScreenCover
(
isPresented
:
$
isVideoPlayerPresented
)
{
if
let
videoUrl
=
message
.
videoUrl
,
let
url
=
URL
(
string
:
videoUrl
)
{
VideoPlayerView
(
videoURL
:
url
)
}
}
}
func
viewerCnt
()
->
(
Int
,
Int
)
{
...
...
@@ -95,16 +90,6 @@ struct MyChatContentView: View {
}
}
struct
VideoPlayerView
:
View
{
let
videoURL
:
URL
var
body
:
some
View
{
VideoPlayer
(
player
:
AVPlayer
(
url
:
videoURL
))
.
navigationTitle
(
"動画再生"
)
.
navigationBarTitleDisplayMode
(
.
inline
)
}
}
#Preview {
MyChatContentView
(
message
:
ChatMessage
(
shipId
:
10000003
,
...
...
Seilassist/Sailassist/Chat/View/OtherChatContentView.swift
View file @
7913f764
...
...
@@ -8,7 +8,6 @@ import SwiftUI
import
AVKit
struct
OtherChatContentView
:
View
{
@State
private
var
isVideoPlayerPresented
=
false
var
message
:
ChatMessage
var
onMediaLoaded
:
(()
->
Void
)?
=
nil
...
...
@@ -26,10 +25,12 @@ struct OtherChatContentView: View {
if
msg
.
contains
(
".jpg"
)
||
msg
.
contains
(
".png"
)
{
ChatUrlImageView
(
imageUrl
:
msg
,
onLoad
:
onMediaLoaded
)
.
onTapGesture
{
if
message
.
type
==
3
,
let
videoUrl
=
message
.
videoUrl
,
let
url
=
URL
(
string
:
videoUrl
)
{
isVideoPlayerPresented
=
true
var
urlString
:
String
=
HttpRequestType
.
RawImage
.
rawValue
urlString
=
urlString
.
replacingOccurrences
(
of
:
"XXXXX"
,
with
:
String
(
message
.
shipId
))
urlString
=
urlString
.
replacingOccurrences
(
of
:
"YYYYY"
,
with
:
String
(
message
.
messageId
))
if
let
url
=
URL
(
string
:
urlString
)
{
UIApplication
.
shared
.
open
(
url
)
}
}
}
else
{
...
...
@@ -60,12 +61,6 @@ struct OtherChatContentView: View {
.
padding
(
.
leading
,
20
)
Spacer
()
}
.
fullScreenCover
(
isPresented
:
$
isVideoPlayerPresented
)
{
if
let
videoUrl
=
message
.
videoUrl
,
let
url
=
URL
(
string
:
videoUrl
)
{
VideoPlayerView
(
videoURL
:
url
)
}
}
}
}
...
...
Seilassist/Sailassist/Json/ResGetMessages.swift
View file @
7913f764
...
...
@@ -28,7 +28,6 @@ struct ChatMessage: Codable {
var
fromId
:
String
?
//ユーザーID
var
mode
:
Int
// 0:通常 , 1:Warning中
var
message
:
String
?
//テキスト時:テキスト , 画像時:サムネイルのUri
var
videoUrl
:
String
?
//TODO: - テスト
var
stampId
:
Int
//スタンプ番号 0:Fire~
var
Latitude
:
Double
?
//TODO: - テスト
var
Longitude
:
Double
?
//TODO: - テスト
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment