Stream Video Swift Xcode10
I am trying to stream a video from my server. It working in Android and also in iOS, if I download it and put in app's bundle. But not able to stream through URL. I have tried other URL for streaming, and all are working. Below is the code I am using.
//its working
//let str = "https://www.radiantmediaplayer.com/media/bbb-360p.mp4"
//not able to stream from this url
let str = "http://158.69.119.121:5555/uploads/post_images/dyqZzJprVCgUxX676ELQTbmEk32EjzBIqrbqhKyr2Sk9fATIa9.mp4"
if let url = URL(string: str){
let player = AVPlayer(url: url)
let playervc = AVPlayerViewController()
playervc.player = player
self.present(playervc, animated: true) {
playervc.player!.play()
}
}
php swift laravel
add a comment |
I am trying to stream a video from my server. It working in Android and also in iOS, if I download it and put in app's bundle. But not able to stream through URL. I have tried other URL for streaming, and all are working. Below is the code I am using.
//its working
//let str = "https://www.radiantmediaplayer.com/media/bbb-360p.mp4"
//not able to stream from this url
let str = "http://158.69.119.121:5555/uploads/post_images/dyqZzJprVCgUxX676ELQTbmEk32EjzBIqrbqhKyr2Sk9fATIa9.mp4"
if let url = URL(string: str){
let player = AVPlayer(url: url)
let playervc = AVPlayerViewController()
playervc.player = player
self.present(playervc, animated: true) {
playervc.player!.play()
}
}
php swift laravel
You may need to install SSL on your server. http connections aren't accepted by default. or you can add exception for your server in info.plist
– Sahil Manchanda
Nov 13 at 5:39
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
– Ali M Irshad
Nov 13 at 5:47
Having this already @SahilManchanda
– Ali M Irshad
Nov 13 at 5:48
Let me test and get back to you
– Sahil Manchanda
Nov 13 at 5:51
add a comment |
I am trying to stream a video from my server. It working in Android and also in iOS, if I download it and put in app's bundle. But not able to stream through URL. I have tried other URL for streaming, and all are working. Below is the code I am using.
//its working
//let str = "https://www.radiantmediaplayer.com/media/bbb-360p.mp4"
//not able to stream from this url
let str = "http://158.69.119.121:5555/uploads/post_images/dyqZzJprVCgUxX676ELQTbmEk32EjzBIqrbqhKyr2Sk9fATIa9.mp4"
if let url = URL(string: str){
let player = AVPlayer(url: url)
let playervc = AVPlayerViewController()
playervc.player = player
self.present(playervc, animated: true) {
playervc.player!.play()
}
}
php swift laravel
I am trying to stream a video from my server. It working in Android and also in iOS, if I download it and put in app's bundle. But not able to stream through URL. I have tried other URL for streaming, and all are working. Below is the code I am using.
//its working
//let str = "https://www.radiantmediaplayer.com/media/bbb-360p.mp4"
//not able to stream from this url
let str = "http://158.69.119.121:5555/uploads/post_images/dyqZzJprVCgUxX676ELQTbmEk32EjzBIqrbqhKyr2Sk9fATIa9.mp4"
if let url = URL(string: str){
let player = AVPlayer(url: url)
let playervc = AVPlayerViewController()
playervc.player = player
self.present(playervc, animated: true) {
playervc.player!.play()
}
}
php swift laravel
php swift laravel
edited Nov 13 at 5:42
Ashish Kakkad
18.2k867106
18.2k867106
asked Nov 13 at 5:30
Ali M Irshad
617
617
You may need to install SSL on your server. http connections aren't accepted by default. or you can add exception for your server in info.plist
– Sahil Manchanda
Nov 13 at 5:39
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
– Ali M Irshad
Nov 13 at 5:47
Having this already @SahilManchanda
– Ali M Irshad
Nov 13 at 5:48
Let me test and get back to you
– Sahil Manchanda
Nov 13 at 5:51
add a comment |
You may need to install SSL on your server. http connections aren't accepted by default. or you can add exception for your server in info.plist
– Sahil Manchanda
Nov 13 at 5:39
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
– Ali M Irshad
Nov 13 at 5:47
Having this already @SahilManchanda
– Ali M Irshad
Nov 13 at 5:48
Let me test and get back to you
– Sahil Manchanda
Nov 13 at 5:51
You may need to install SSL on your server. http connections aren't accepted by default. or you can add exception for your server in info.plist
– Sahil Manchanda
Nov 13 at 5:39
You may need to install SSL on your server. http connections aren't accepted by default. or you can add exception for your server in info.plist
– Sahil Manchanda
Nov 13 at 5:39
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
– Ali M Irshad
Nov 13 at 5:47
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
– Ali M Irshad
Nov 13 at 5:47
Having this already @SahilManchanda
– Ali M Irshad
Nov 13 at 5:48
Having this already @SahilManchanda
– Ali M Irshad
Nov 13 at 5:48
Let me test and get back to you
– Sahil Manchanda
Nov 13 at 5:51
Let me test and get back to you
– Sahil Manchanda
Nov 13 at 5:51
add a comment |
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274399%2fstream-video-swift-xcode10%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53274399%2fstream-video-swift-xcode10%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
You may need to install SSL on your server. http connections aren't accepted by default. or you can add exception for your server in info.plist
– Sahil Manchanda
Nov 13 at 5:39
<key>NSAppTransportSecurity</key> <dict> <key>NSAllowsArbitraryLoads</key> <true/> </dict>
– Ali M Irshad
Nov 13 at 5:47
Having this already @SahilManchanda
– Ali M Irshad
Nov 13 at 5:48
Let me test and get back to you
– Sahil Manchanda
Nov 13 at 5:51