Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
LibVLCSharp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
76
Issues
76
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
VideoLAN
LibVLCSharp
Commits
a1521680
Commit
a1521680
authored
Sep 28, 2020
by
Martin Finkel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Apple samples: Dispose resources
# Conflicts: # samples/LibVLCSharp.iOS.Sample/ViewController.cs
parent
0e9e6ac8
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
5 deletions
+40
-5
samples/LibVLCSharp.Mac.Sample/ViewController.cs
samples/LibVLCSharp.Mac.Sample/ViewController.cs
+12
-2
samples/LibVLCSharp.iOS.Sample/LibVLCSharp.iOS.Sample.csproj
samples/LibVLCSharp.iOS.Sample/LibVLCSharp.iOS.Sample.csproj
+4
-0
samples/LibVLCSharp.iOS.Sample/ViewController.cs
samples/LibVLCSharp.iOS.Sample/ViewController.cs
+11
-2
samples/LibVLCSharp.tvOS.Sample/ViewController.cs
samples/LibVLCSharp.tvOS.Sample/ViewController.cs
+13
-1
No files found.
samples/LibVLCSharp.Mac.Sample/ViewController.cs
View file @
a1521680
...
...
@@ -31,7 +31,9 @@ namespace LibVLCSharp.Mac.Sample
View
=
_videoView
;
_videoView
.
MediaPlayer
.
Play
(
new
Media
(
_libVLC
,
new
Uri
(
"https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"
)));
var
media
=
new
Media
(
_libVLC
,
new
Uri
(
"https://download.blender.org/peach/bigbuckbunny_movies/BigBuckBunny_320x180.mp4"
));
_videoView
.
MediaPlayer
.
Play
(
media
);
media
.
Dispose
();
}
public
override
NSObject
RepresentedObject
...
...
@@ -46,5 +48,13 @@ namespace LibVLCSharp.Mac.Sample
// Update the view, if already loaded.
}
}
}
public
override
void
ViewWillDisappear
()
{
base
.
ViewWillDisappear
();
_mediaPlayer
.
Dispose
();
_libVLC
.
Dispose
();
}
}
}
\ No newline at end of file
samples/LibVLCSharp.iOS.Sample/LibVLCSharp.iOS.Sample.csproj
View file @
a1521680
...
...
@@ -24,6 +24,7 @@
<MtouchArch>
x86_64
</MtouchArch>
<MtouchLink>
None
</MtouchLink>
<MtouchDebug>
true
</MtouchDebug>
<LangVersion>
8.0
</LangVersion>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|iPhoneSimulator' "
>
<DebugType>
none
</DebugType>
...
...
@@ -34,6 +35,7 @@
<MtouchLink>
None
</MtouchLink>
<MtouchArch>
x86_64
</MtouchArch>
<ConsolePause>
false
</ConsolePause>
<LangVersion>
8.0
</LangVersion>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Debug|iPhone' "
>
<DebugSymbols>
true
</DebugSymbols>
...
...
@@ -48,6 +50,7 @@
<CodesignEntitlements>
Entitlements.plist
</CodesignEntitlements>
<CodesignKey>
iPhone Developer
</CodesignKey>
<MtouchDebug>
true
</MtouchDebug>
<LangVersion>
8.0
</LangVersion>
</PropertyGroup>
<PropertyGroup
Condition=
" '$(Configuration)|$(Platform)' == 'Release|iPhone' "
>
<DebugType>
none
</DebugType>
...
...
@@ -59,6 +62,7 @@
<MtouchArch>
ARM64
</MtouchArch>
<ConsolePause>
false
</ConsolePause>
<CodesignKey>
iPhone Developer
</CodesignKey>
<LangVersion>
8.0
</LangVersion>
</PropertyGroup>
<ItemGroup>
<Compile
Include=
"Main.cs"
/>
...
...
samples/LibVLCSharp.iOS.Sample/ViewController.cs
View file @
a1521680
using
LibVLCSharp.Platforms.iOS
;
using
LibVLCSharp
;
using
System
;
using
UIKit
;
namespace
LibVLCSharp.iOS.Sample
...
...
@@ -22,7 +22,16 @@ namespace LibVLCSharp.iOS.Sample
View
=
_videoView
;
_videoView
.
MediaPlayer
.
Play
(
new
Media
(
_libVLC
,
new
Uri
(
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
)));
using
var
media
=
new
Media
(
_libVLC
,
new
Uri
(
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
));
_videoView
.
MediaPlayer
.
Play
(
media
);
}
public
override
void
ViewWillDisappear
(
bool
animated
)
{
base
.
ViewWillDisappear
(
animated
);
_mediaPlayer
.
Dispose
();
_libVLC
.
Dispose
();
}
}
}
samples/LibVLCSharp.tvOS.Sample/ViewController.cs
View file @
a1521680
...
...
@@ -21,7 +21,19 @@ namespace LibVLCSharp.tvOS.Sample
View
=
_videoView
;
_videoView
.
MediaPlayer
.
Play
(
new
Media
(
_libVLC
,
new
Uri
(
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
)));
var
media
=
new
Media
(
_libVLC
,
new
Uri
(
"http://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4"
));
_videoView
.
MediaPlayer
.
Play
(
media
);
media
.
Dispose
();
}
public
override
void
ViewWillDisappear
(
bool
animated
)
{
base
.
ViewWillDisappear
(
animated
);
_mediaPlayer
.
Dispose
();
_libVLC
.
Dispose
();
}
}
}
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