回答編集履歴
2
追記しました。
test
CHANGED
@@ -33,3 +33,21 @@
|
|
33
33
|
参考記事
|
34
34
|
|
35
35
|
[https://joyplot.com/documents/2016/11/03/swift-fileurl-path/](https://joyplot.com/documents/2016/11/03/swift-fileurl-path/)
|
36
|
+
|
37
|
+
|
38
|
+
|
39
|
+
【追記】
|
40
|
+
|
41
|
+
```
|
42
|
+
|
43
|
+
let fm = FileManager.default
|
44
|
+
|
45
|
+
let url = try! fm.url(for:.documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false)
|
46
|
+
|
47
|
+
let path = url.appendingPathComponent("video.mp4")
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
let videoPlayer = AVPlayer(url: URL(fileURLWithPath: path)!)
|
52
|
+
|
53
|
+
```
|
1
一箇所修正しました
test
CHANGED
@@ -24,7 +24,7 @@
|
|
24
24
|
|
25
25
|
|
26
26
|
|
27
|
-
let videoPlayer = AVPlayer(url: URL(fileURLWithPath: path))
|
27
|
+
let videoPlayer = AVPlayer(url: URL(fileURLWithPath: path)!)
|
28
28
|
|
29
29
|
```
|
30
30
|
|