FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
API-Examples/iOS/APIExample/ViewController.swift at master · JioaXiake/API-Examples · GitHub
JioaXiake
/
API-Examples
Public
forked from
AgoraIO/API-Examples
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
API-Examples
/
iOS
/
APIExample
/
ViewController.swift
Copy path
More file actions
More file actions
Latest commit
History
History
History
115 lines (101 loc) · 5.74 KB
Breadcrumbs
API-Examples
/
iOS
/
APIExample
/
ViewController.swift
Copy path
File metadata and controls
115 lines (101 loc) · 5.74 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
//
// ViewController.swift
// APIExample
//
// Created by 张乾泽 on 2020/4/16.
// Copyright © 2020 Agora Corp. All rights reserved.
//
import
UIKit
import
Floaty
struct
MenuSection
{
var
name
:
String
var
rows
:
[
MenuItem
]
}
struct
MenuItem
{
var
name
:
String
var
entry
:
String
=
"
EntryViewController
"
var
storyboard
:
String
=
"
Main
"
var
controller
:
String
var
note
:
String
=
"
"
}
class
ViewController
:
AGViewController
{
var
menus
:
[
MenuSection
]
=
[
MenuSection
(
name
:
"
Basic
"
,
rows
:
[
MenuItem
(
name
:
"
Join a channel (Video)
"
.
localized
,
storyboard
:
"
JoinChannelVideo
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Join a channel (Audio)
"
.
localized
,
storyboard
:
"
JoinChannelAudio
"
,
controller
:
"
"
)
]
)
,
MenuSection
(
name
:
"
Anvanced
"
,
rows
:
[
MenuItem
(
name
:
"
Live Streaming
"
.
localized
,
storyboard
:
"
LiveStreaming
"
,
controller
:
"
LiveStreaming
"
)
,
MenuItem
(
name
:
"
RTMP Streaming
"
.
localized
,
storyboard
:
"
RTMPStreaming
"
,
controller
:
"
RTMPStreaming
"
)
,
MenuItem
(
name
:
"
Media Injection
"
.
localized
,
storyboard
:
"
RTMPInjection
"
,
controller
:
"
RTMPInjection
"
.
localized
)
,
MenuItem
(
name
:
"
Video Metadata
"
.
localized
,
storyboard
:
"
VideoMetadata
"
,
controller
:
"
VideoMetadata
"
.
localized
)
,
MenuItem
(
name
:
"
Voice Changer
"
.
localized
,
storyboard
:
"
VoiceChanger
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Custom Audio Source
"
.
localized
,
storyboard
:
"
CustomAudioSource
"
,
controller
:
"
CustomAudioSource
"
)
,
MenuItem
(
name
:
"
Custom Audio Render
"
.
localized
,
storyboard
:
"
CustomAudioRender
"
,
controller
:
"
CustomAudioRender
"
)
,
MenuItem
(
name
:
"
Custom Video Source(MediaIO)
"
.
localized
,
storyboard
:
"
CustomVideoSourceMediaIO
"
,
controller
:
"
CustomVideoSourceMediaIO
"
)
,
MenuItem
(
name
:
"
Custom Video Source(Push)
"
.
localized
,
storyboard
:
"
CustomVideoSourcePush
"
,
controller
:
"
CustomVideoSourcePush
"
)
,
MenuItem
(
name
:
"
Custom Video Render
"
.
localized
,
storyboard
:
"
CustomVideoRender
"
,
controller
:
"
CustomVideoRender
"
)
,
MenuItem
(
name
:
"
Raw Media Data
"
.
localized
,
storyboard
:
"
RawMediaData
"
,
controller
:
"
RawMediaData
"
)
,
MenuItem
(
name
:
"
Quick Switch Channel
"
.
localized
,
controller
:
"
QuickSwitchChannel
"
)
,
MenuItem
(
name
:
"
Join Multiple Channels
"
.
localized
,
storyboard
:
"
JoinMultiChannel
"
,
controller
:
"
JoinMultiChannel
"
)
,
MenuItem
(
name
:
"
Stream Encryption
"
.
localized
,
storyboard
:
"
StreamEncryption
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Audio Mixing
"
.
localized
,
storyboard
:
"
AudioMixing
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Precall Test
"
.
localized
,
storyboard
:
"
PrecallTest
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Screen Share
"
.
localized
,
storyboard
:
"
ScreenShare
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Super Resolution
"
.
localized
,
storyboard
:
"
SuperResolution
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Media Channel Relay
"
.
localized
,
storyboard
:
"
MediaChannelRelay
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
Media Player
"
.
localized
,
storyboard
:
"
MediaPlayer
"
,
controller
:
"
"
)
,
MenuItem
(
name
:
"
ARKit
"
.
localized
,
storyboard
:
"
ARKit
"
,
controller
:
"
"
)
]
)
,
]
override
func
viewDidLoad
(
)
{
super
.
viewDidLoad
(
)
Floaty
.
global
.
button
.
addItem
(
title
:
"
Send Logs
"
,
handler
:
{
item
in
LogUtils
.
writeAppLogsToDisk
(
)
let
activity
=
UIActivityViewController
(
activityItems
:
[
NSURL
(
fileURLWithPath
:
LogUtils
.
logFolder
(
)
,
isDirectory
:
true
)
]
,
applicationActivities
:
nil
)
UIApplication
.
topMostViewController
?
.
present
(
activity
,
animated
:
true
,
completion
:
nil
)
}
)
Floaty
.
global
.
button
.
addItem
(
title
:
"
Clean Up
"
,
handler
:
{
item
in
LogUtils
.
cleanUp
(
)
}
)
Floaty
.
global
.
button
.
isDraggable
=
true
Floaty
.
global
.
show
(
)
}
}
extension
ViewController
:
UITableViewDataSource
{
func
tableView
(
_ tableView
:
UITableView
,
numberOfRowsInSection section
:
Int
)
->
Int
{
return
menus
[
section
]
.
rows
.
count
}
func
numberOfSections
(
in tableView
:
UITableView
)
->
Int
{
return
menus
.
count
}
func
tableView
(
_ tableView
:
UITableView
,
titleForHeaderInSection section
:
Int
)
->
String
?
{
return
menus
[
section
]
.
name
}
func
tableView
(
_ tableView
:
UITableView
,
cellForRowAt indexPath
:
IndexPath
)
->
UITableViewCell
{
let
cellIdentifier
=
"
menuCell
"
var
cell
=
tableView
.
dequeueReusableCell
(
withIdentifier
:
cellIdentifier
)
if
cell
==
nil
{
cell
=
UITableViewCell
(
style
:
.
default
,
reuseIdentifier
:
cellIdentifier
)
}
cell
?
.
textLabel
?
.
text
=
menus
[
indexPath
.
section
]
.
rows
[
indexPath
.
row
]
.
name
return
cell!
}
}
extension
ViewController
:
UITableViewDelegate
{
func
tableView
(
_ tableView
:
UITableView
,
didSelectRowAt indexPath
:
IndexPath
)
{
tableView
.
deselectRow
(
at
:
indexPath
,
animated
:
true
)
let
menuItem
=
menus
[
indexPath
.
section
]
.
rows
[
indexPath
.
row
]
let
storyBoard
:
UIStoryboard
=
UIStoryboard
(
name
:
menuItem
.
storyboard
,
bundle
:
nil
)
if
(
menuItem
.
storyboard
==
"
Main
"
)
{
guard
let
entryViewController
=
storyBoard
.
instantiateViewController
(
withIdentifier
:
menuItem
.
entry
)
as?
EntryViewController
else
{
return
}
entryViewController
.
nextVCIdentifier
=
menuItem
.
controller
entryViewController
.
title
=
menuItem
.
name
entryViewController
.
note
=
menuItem
.
note
self
.
navigationController
?
.
pushViewController
(
entryViewController
,
animated
:
true
)
}
else
{
let
entryViewController
:
UIViewController
=
storyBoard
.
instantiateViewController
(
withIdentifier
:
menuItem
.
entry
)
self
.
navigationController
?
.
pushViewController
(
entryViewController
,
animated
:
true
)
}
}
}
Back
|
FazBrowse Home
|
New Git URL