Load iframe tag (video) from html string into web view using Swift 3

Load iframe tag (video) from html string into web view using Swift 3

Content Index :

Load iframe tag (video) from html string into web view using Swift 3
Tag : ios , By : Gazza
Date : November 14 2020, 03:01 PM

will help you enter image description here , You should be able to use .loadHTMLString(). Change your code to:
    let myJSON = try JSONSerialization.jsonObject(with: content) as? [String:Any]

    let text:String = myJSON?["text"] as! String

    self.webView.loadHTMLString(text, baseURL: URL(string: "https://"))
adassa dasdas dsadas .<\/p>
    let myJSON = try JSONSerialization.jsonObject(with: content) as? [String:Any]

    let text:String = myJSON?["text"] as! String

    // remove the extra "\" escape chars
    let cleanedText = text.replacingOccurrences(of: "\\/", with: "/")

    self.webView.loadHTMLString(cleanedText, baseURL: URL(string: "https://"))

No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

Load two HTML documents at once ( Load iframe contents from string )

Tag : javascript , By : user123284
Date : March 29 2020, 07:55 AM
This might help you I have a rather strange need. I need to be able to render two documents at once in the same browser window, but it is not as simple as it sounds. , You can do this, but you have to be careful to escape your string.
<iframe src="javascript: '<html><head><title>iframe</title></head><body>IFRAME</body></html>'"></iframe>

It is posible to load customise HTML view into webView in swift?

Tag : swift , By : user171555
Date : March 29 2020, 07:55 AM
seems to work fine I have found the solution for my question and for that THIS tutorial helps me a lot.
as shown into this tutorial here is the step by step example for load a customised HTML View into webView.
overridefuncviewDidLoad() {
    letmyHTMLString:String! = "<h1>Hello Pizza!</h1>"
    myWebView.loadHTMLString(myHTMLString, baseURL: nil)
letmyHTMLString:String! = "<h1 style=\"font-family: Helvetica\">Hello Pizza</h1><p>Tap the buttons above to see <strong>some cool stuff</strong> with <code>UIWebView</code><p><img src=\"https://apppie.files.wordpress.com/2014/09/photo-sep-14-7-40-59-pm_small1.jpg\">"
<!--<DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
<!-- Based on lesson from http://www.w3.org/Style/Examples/011/firstcss -->Hello Pizza Home
        <!-- Site navigation menu -->
<div class="navbar">
            <a href="index.html">Home</a>
            <a href="musings.html">Toppings</a>
            <a href="town.html">Crust</a>
            <a href="links.html">Ovens</a>
<div class="content">
        <!-- Main content -->
<h1>Hello Pizza!</h1>
This is a site for the love of all things pizza!
But we are not just pizza, we are with anything on a flatbread. So look around and you will find naan, flatbreads, pitas and tortilla related stuff too!!!
If that is not enough, check our sister site <a href="pie">Hello Pie</a>
<img src="https://apppie.files.wordpress.com/2014/09/photo-sep-14-7-40-59-pm_small1.jpg" alt="" />
        <!-- Sign and date the page, it's only polite! -->
<address>Made 27 October 2012
by makeapppie.com.</address>
@IBAction func helloPizza(sender: UIBarButtonItem) {
let myURL = NSBundle.mainBundle().URLForResource("myHtml", withExtension: "html")
let requestObj = NSURLRequest(URL: myURL!)
body {
color: #eeeeee;
background: #a0a088;
h1 {
color: #dd1111;
font-size: 18pt}
font-weight: bold;
color: #ffffaa;
padding-left: 5px;
max-width: 90%;
max-height: 90%;
box-shadow: 3px 3px 3px 0px #202020
.navbar {
background-color: #000000;
color: white;
position: absolute;
top: 0em;
left: 0em;
width: 100% }
padding-left: 1em;
padding-top: 1em;

Lazy Load youtube video from iframe API

Tag : javascript , By : Si Gardner
Date : March 29 2020, 07:55 AM
With these it helps I want to lazy load the youtube video with iframe API. ie. load only the poster image in the beginning and when user clicks on it then only load the actual image and its content. , Finally it worked, below code is in angularJS.
<div data-ng-repeat="video in videoIds track by $index">
    <div id="uniQueId" ng-click="playVideo(video, 'player' + $index)">
        <div class="video-play-button"></div>
 $scope.playVideo = function(videoId, id) {
        $scope.players[id] = new YT.Player(id, {
            videoId: videoId,
            width: '400',
            height: '300',
            playerVars: { 'autoplay': 1 },
            events: {
                'onStateChange': $scope.onPlayerStateChange

load html string in ios swift except UIWebView

Tag : html , By : Noah
Date : March 29 2020, 07:55 AM
seems to work fine you can use NSAttributed String for load in UILabel or use UItextView to load HTML String for e.g
let htmlString: String = "<p>\r\n\t  Whether you are viewing a premium-quality 2D picture or seeing incredible 3D depth, images are breathtakingly real in Samsung Full HD. Combine with a 3D TV and 3D active shutter glasses to view the latest Hollywood 3D titles or amplify your viewing experience by upconverting 2D content to immersive 3D.\r\n</p>"

let  attrStr: NSAttributedString = try! NSAttributedString(data: htmlString.dataUsingEncoding(NSUnicodeStringEncoding), options: [NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType], documentAttributes: nil)

yourlabel.attributedText = attrStr

Get HTML of an iframe loaded via ajax (please note that iframe is containing a webpage that needs javascript to load)

Tag : php , By : August
Date : March 29 2020, 07:55 AM
Related Posts Related QUESTIONS :
  • How to make SwiftUI view fullscreen?
  • RAM, JSC, Views, UI and JS usage table appearing whenever I launch my react native app. How to remove this table?
  • Change status bar background color using UIStatusBarManager
  • Should we make tapGesture component an IBAction or IBOutlet to capture the tap event?
  • Iframe automatically goes full screen using Ionic 3.9.2 on iOS
  • How to calculate score out of 1000 given some seconds (In Double)
  • How to calculate time (minutes) between two dates in swift?
  • There was problem loading requested app.it looks like you may be using LAN URL
  • Swift circular corners doesn't work properly on different screen sizes
  • How change .navigationBarTitle font in SwiftUI?
  • What happens if `MPSCNNConvolutionDataSource` protocol's `load` method return false?
  • Why does the UIBarButtonItem not show up when I create it with code?
  • How to prevent following view controller inheriting navigation view controller bar?
  • What does it mean when .xcodeproj files are shown in red in Xcode?
  • Xcode SwiftUI how to scroll the Preview Canvas?
  • Expand tableview and increase scrollview content size by an appropriate difference on clicking a button inside a table c
  • xcodebuild failed with return code: 65 - using CLI/Appcenter but no error messages
  • "'isDeveloperModeEnabled' is deprecated: This no longer needs to be set during development. " What is isDevelo
  • Right click in UIKit for Mac
  • How we Support Dark Mode in Current iOS App with iOS 13?
  • Security vulnerablility issue in ios mobile app
  • How to set a background color for the viewController in swiftUI?
  • SwiftUI : Segue navigation
  • iOS 13 Custom UISearchBar _searchField crash
  • USDZ models have holes in SceneKit but not QuickLook
  • Why does iOS Password Autofill not prompt to save password on keychain?
  • Pushing information to firebase after event is created(Firebase-Realtime-Database)
  • Xcode 11 Beta and Carthage bootstrap
  • How to change the status bar background color and text color on iOS 13?
  • Using Core Data with SwiftUI
  • How should I do to wait all the data downloaded completely and show on TableView?
  • Can we specify the number of rows that can be shown in each section of a collection view
  • Why sometimes completion handler not called?
  • Protocol 'View' can only be used as a generic constraint because it has Self or associated type requirements
  • In UIKit we can set label.numberOfLines = 0 when we do not know how many lines the text will take? What is the alternati
  • Swift ISO8601 format to Date returning fatal error
  • SwiftUI Login Page Layout
  • Xcode: Could not locate installed application. Install claimed to have succeeded, but application could not be found on
  • See the TestFlight crash log in the Xcode
  • Why does zero UIView's CALayer.speed stops UIAlertController's buttons from working?
  • Firestore collectionGroup query returns empty result
  • Modify text in SwiftUI
  • CNCopyCurrentNetworkInfo with iOS 13
  • WWDC 2019 - iOS13 April 2020 requirement
  • Nativescript IPhone X - How to "hide" home indicator behind two swipes to go to home screen
  • Should I use a singleton location manager in Swift?
  • Accessibility problem in reusable TableViewCell
  • Remove top line containing Done button from Keyboard Using Storyboard or in Swift
  • Swift Storyboard - Centring an Icon and multi-line text horizontally
  • viewDidAppear is delayed by 0.5 sec
  • Pass URL values to SecondView Controller WebView (WKWebView)
  • How to upload images faster on iOS, when using takePictureAsync?
  • Tableview multiple sections with one floating header
  • UITextView: Huge Memory Usage
  • How to put a logo in NavigationView in swiftui?
  • How can I load an UIImage into a SwiftUI Image asynchronously?
  • How to remove highlight on tap of List with SwiftUI?
  • how to use customized toolbar in multiple viewcontroller without repeating the code and copying the elements (swift)?
  • iPhone 7 simulator is not found on Xcode 11 beta
  • SwiftUI view is in the middle instead of in the top
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com