Button on webview

Hii,
I am new to Iphone development. Can i place a button on webview so that the button will appear when we touch the webview.

vipin001:
Suggest you try asking on the iOS Forums where the real activity happens
https://devforums.apple.com/community/ios
Good luck
Ken

Similar Messages

  • How do we load a html file from a folder on a sdcard into a webview panel c# windows phone 8.1

    Every time a character is made in my app it is saved to an html file named after it in a folder called RpgApp on the sdcard
    so if the characters name is john smith then there will be a john-smith.htm located in RpgApp folder on the sdcard
    now that bit works great
    the app also makes a list of buttons each one named after a file inside the RpgApp folder (so in this case there would be a button named john-smith.html ) and the content is the same as the name so it displays as john-smith.html
    each button has the following method on click 
    private void htmlButtonClick(object sender, RoutedEventArgs e)
    StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;
    string curDir = externalDevices.ToString();
    Button button = sender as Button;
    Uri result = new Uri(String.Format("file:///{0}/RpgApp/"+button.Name,curDir));
    web.Navigate(result);
    now the idea is that when you click the button the webview control (aptly named "web") loads up the content of the file (you notice button.name as part of the url? well thats because the buttons name is the file name :) 
    but instead the browser remains unmoved, just sits thier blank
    to test i changed web.Navigate(result); to web.NavigateToString(button.Name);
    and sure enough when ever i clicked a button the webview displayed the name of the button i clicked
    any ideas?

    Hi D.Eastwick,
    I will recommand you read the html file content from the folder in the sd card and convert it to a string, after that we can use the
    NavigateToString method to load the html content in the WebView.
    Besides, please try to do a test by puting the html file in a
    LocalFolder and use the URL like this: "ms-appdata:///...." to see if it works.
    Best Regards,
    Amy Peng
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • A bug with the new WebView??

    <font color="blue" size="2" >Hi I'm using javaFX 2.1 with Netbeans 7.2 and java 1.7.5. When trying to run this with WebView shows the error down below. The starnge thing it´s I have and old version of other code and runs without any trouble. Does anybody knows why this happens?. Thanks in advanced.</font>
    <font color="red" size="4" > Here's the code:</font>
    public class AEjemploArrays extends Application {
        private Button btn = new Button();
        private WebView web = new WebView(); //comment this and will work
        @Override
        public void start(Stage stage) {
            StackPane root = new StackPane();
            Scene scene = new Scene(root, 1200, 500);
            BorderPane bp0 = new BorderPane();
            ObservableList<String> titulos = FXCollections.observableArrayList("ArrayList", "Vector", "HashSet", "HashMap");
            ListView<String> lista = new ListView<>(titulos);
            lista.prefHeightProperty().bind(scene.heightProperty().add(-10f));
            lista.setMaxWidth(250);
            lista.getSelectionModel().selectedIndexProperty().addListener(new ChangeListener<Number>() {
                @Override
                public void changed(ObservableValue<? extends Number> ov, Number oldv, Number newv) {
                    System.out.println("" + newv.doubleValue());
            btn.setText("Ejecutar");
            btn.setOnAction(new EventHandler<ActionEvent>() {
                @Override
                public void handle(ActionEvent event) {
                    System.out.println("Hello World!");
            bp0.setLeft(lista);
            root.getChildren().add(bp0);
            stage.setTitle("Diversos arrays y como funcionan");
            stage.setScene(scene);
            stage.show();
        }<font color="red" size="4" > Error message:</font>
    <font color="darkblue" size="3" >ant -f C:\\Users\\ANDRES\\Documents\\NetBeansProjects\\aEjemploArrays jfxsa-run
    init:
    Deleting: C:\Users\ANDRES\Documents\NetBeansProjects\aEjemploArrays\build\built-jar.properties
    deps-jar:
    Updating property file: C:\Users\ANDRES\Documents\NetBeansProjects\aEjemploArrays\build\built-jar.properties
    Compiling 1 source file to C:\Users\ANDRES\Documents\NetBeansProjects\aEjemploArrays\build\classes
    compile:
    Detected JavaFX Ant API version 1.1
    Launching <fx:jar> task from C:\Program Files\Oracle\JavaFX 2.1 SDK\lib\ant-javafx.jar
    Launching <fx:deploy> task from C:\Program Files\Oracle\JavaFX 2.1 SDK\lib\ant-javafx.jar
    Skip jar copy to itself: aEjemploArrays.jar
    jfx-deployment:
    jar:
    run:
    Exception in Application constructor
    java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
         at java.lang.reflect.Method.invoke(Method.java:601)
         at com.javafx.main.Main.launchApp(Main.java:486)
         at com.javafx.main.Main.main(Main.java:638)
    Caused by: java.lang.RuntimeException: Unable to construct Application instance: class aejemploarrays.AEjemploArrays
         at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
         at com.sun.javafx.application.LauncherImpl.access$000(Unknown Source)
         at com.sun.javafx.application.LauncherImpl$1.run(Unknown Source)
         at java.lang.Thread.run(Thread.java:722)
    Caused by: java.lang.reflect.InvocationTargetException
         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
         at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
         ... 4 more
    Caused by: java.lang.IllegalStateException: Not on FX application thread; currentThread = JavaFX-Launcher
         at com.sun.javafx.tk.Toolkit.checkFxUserThread(Unknown Source)
         at com.sun.javafx.tk.quantum.QuantumToolkit.checkFxUserThread(Unknown Source)
         at com.sun.webpane.sg.prism.InvokerImpl.checkEventThread(Unknown Source)
         at com.sun.webpane.platform.WebPage.<init>(Unknown Source)
         at com.sun.webpane.sg.ImplementationManager.createPage(Unknown Source)
         at com.sun.webpane.sg.ImplementationManager.createPage(Unknown Source)
         at javafx.scene.web.WebEngine.<init>(Unknown Source)
         at javafx.scene.web.WebEngine.<init>(Unknown Source)
         at javafx.scene.web.WebView.<init>(Unknown Source)
         at aejemploarrays.AEjemploArrays.<init>(AEjemploArrays.java:29)
         ... 8 more
    Java Result: 1
    jfxsa-run:
    BUILD SUCCESSFUL (total time: 24 seconds)</font>

    Move the new WebView statement into the Start method and all will work fine.
    As the error message says, a WebView needs to be created on the FX Application thread. By trying to create the WebView where you currently are doing it, the creation attempt will be performed on the main thread.
    There is an existing Jira issue to remove the thread restriction on WebView, but it is scheduled for a later release.

  • Handling new window open with WebView

    Hi,
    I'm developing an app where I use webview to display a webpage. The webpage has a link where a file gets downloaded automatically when selected. What I'm trying to do is to get the link of the downloadable file and try to download it from my app. The problem
    I'm facing is that IE automatically opens whenever the downloadable link is pressed. I cant get event handler to detect this scenario. I've seen there could be a solution using Javascript but I dont know how to implement it. I found there is x-ms-webview.MSWebViewNewWindowRequested
    but this one is for Windows 10 only. I wonder if there is an alternative solution for WP8.1. Thanks

    Hi Rob,
    Now I've tried two solutions and none of them worked as expected. Here are the options
    1) In the WebView.NavigationStarted, I download the html content and then modify it to remove target=_blank which triggers opening a new window. I then call  WebView.NavigateToString to call the new html content. Looks like it works somehow but
    the reloaded page does not contain images, links, etc. Is there a way to fix this?
    2) I've tried the solution described in this link:
    http://stackoverflow.com/questions/18799534/notify-click-action-on-button-in-webview
    which is essentially injecting javascript code to handle button clicks.  The code looks like this:
    private void WebView_OnLoadCompleted(object sender, NavigationEventArgs e)
    webView.InvokeScript("eval", new[]
    "var loginButon=document.getElementById(\"login\");" +
    "if (loginButon.addEventListener) {" +
    "loginButon.addEventListener(\"click\", clickFunction, false);" +
    "} else {" +
    "loginButon.attachEvent('onclick', clickFunction);" +
    "} " +
    "function clickFunction(){" +
    " window.external.notify('loginClick');"+
    However, I get error when the code executes webView.InvokeScript (Execption:0x80020101). Do you have any idea why?
    Kind Regards

  • Back Button with Anchor Link in Webview?

    I use UIWebView (in a view controller) to display html pages stored locally on the device. This web view is the "leaf" view from a series of table views using a navigation controller that provides the appropriately-labeled "back" buttons to the table hierarchy tree.
    The problem is that in some of these html pages, I have anchor links to a footnotes html page also residing on the device, and then that web page does appear in the web view but I don't know how to go "back" to the previous web page leaf. The navigation bar of course shows a back button that goes back to one of the table views and not to the preceding web page, the origin of the linked web page.
    So, from a UI and programming prospective, how do I change the navigation back button label to say "Back" (instead of the previous table view) and have it when clicked show the previous web page and not the previous table view?
    Is there where I might use UIWebView delegate functions? But how do I get the navigation button to change its functionality?
    Thanks for any help.

    Is there where I might use UIWebView delegate functions? But how do I get the navigation button to change its functionality?
    You can use the delegate functions to intercept each nav request...
    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
    or you can be told when new data was navigated to:
    - (void)webViewDidFinishLoad:(UIWebView *)webView{
    you can change the Nav bar's left button to be a custom view:
    UIBarButtonItem *leftButton = [[[UIBarButtonItem alloc]
    initWithTitle:NSLocalizedString(@"Back", @"")
    style:UIBarButtonItemStyleBordered
    target:self
    action:@selector(goBack:)] autorelease];
    self.navigationItem.leftBarButtonItem = leftButton;
    You need to provide a function to perform the goBack.
    hope this helps
    michael golden

  • How i can rotate the webview in all the 4 direction by button action ,please suggest the awnser for that

    Hi  Anyone can give the idea for rotate the webview in view in  all the direction by button clicked action.

    I have not simple soluce but only a crazy idea :
    Export VI as VI Strings (VI Method) then search for each text file the corresponding info such as :
    <BDCONTENT>
    <CONTROL ID=81 type="String Constant" >
      <DESC></DESC>
      <TIP></TIP>
      <PARTS>
       <PART ID=11 order=0 type="Text"><LABEL><STEXT>TEST</STEXT></LABEL></PART>
      </PARTS>
      <DEFAULT><SAME_AS_LABEL></DEFAULT>
     </CONTROL>
    but I recognize it's long & delicate to develop it, surely very long in execution time...
    It's only to help but I hope there exists a better way
    Message Edité par J.DECHET le 01-13-2010 12:45 PM

  • Buttons 'go to URL won't' open in webviewer

    Hello
    I have multiple buttons in my folio, they all work great on iPad, but when i open the folio in the webviewer nothing happens when ik click them.
    Someone have a solution for my problem?
    Thx!

    Found the problem. Seems to be a bug. The drop-box won't change but if you set it to "New" and then publish, it works. The box will still say "Current", but it will open a new window.

  • Webview on menue buttons broken in r25

    Hello,
    any information why the behavior of custom menu items configured as webview have totaly changed ??
    up tp sprint 24, external http:// or https:// links pointing to an customer selfeservice system, where kept and displaied within the app, now they open a
    safari browser instance, even without the notification of exiting the app.
    thnx for any information, how to address this problem
    kind regards
    Michael

    Hello,
    thank you very much. We confirm the fix of the problem.
    kind regard
    Michael

  • Focussing a WebView after a MessageDialog is closed

    I've got a contentEditable based
    editor within a WebView in
    my Windows Store app. Certain keyboard shortcuts and buttons can cause a MessageDialog to
    open (intentionally). When this dialog is dismissed, the editor no longer has focus. I've tried setting focus every way I know, and it won't work. Here's a sample app which illustrates the issue
    MainPage.xaml
    <Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
    <WebView x:Name="Editor" Margin="200"></WebView>
    </Grid>
    <Page.BottomAppBar>
    <CommandBar x:Name="CommandBar_Editor" Visibility="Visible">
    <AppBarButton Label="Debug" Icon="Setting">
    <AppBarButton.Flyout>
    <MenuFlyout>
    <MenuFlyoutItem Text="show dialog, then focus" Click="MenuFlyoutItem_Click_1"/>
    </MenuFlyout>
    </AppBarButton.Flyout>
    </AppBarButton>
    </CommandBar>
    </Page.BottomAppBar>
    </Page>
    MainPage.xaml.cs
    public sealed partial class MainPage : Page
    public MainPage()
    this.InitializeComponent();
    protected override void OnNavigatedTo(NavigationEventArgs e)
    base.OnNavigatedTo(e);
    Editor.NavigateToString("<script type='text/javascript'>function focus_please(){ document.getElementById('editor').focus(); }</script><div id='editor' contentEditable='true'>It was the best of times, it was the worst of times</div>");
    private async void MenuFlyoutItem_Click_1(object sender, RoutedEventArgs e)
    MessageDialog dialog = new MessageDialog("this should set focus to editor on close", "test");
    UICommand okCommand = new UICommand("OK");
    dialog.Commands.Add(okCommand);
    IUICommand response = await dialog.ShowAsync();
    if (response == okCommand)
    await Window.Current.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
    Editor.Focus(FocusState.Programmatic);
    await Window.Current.CoreWindow.Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
    Editor.InvokeScript("focus_please", null);
    The code above will work if the user is using the touch interface. That is, if the message dialog is dismissed with a touch, the div within the WebView focusses. 
    However, if the user is using Mouse / Keyboard and clicks to dismiss the dialog, the div will not focus.
    Is this a bug in WinRT? Is there any known workaround? 

    Hi Roryok - I worked on this issue when you had the StackOverflow question.  I could not get it to work only sometimes.  I am going to file a bug on this issue.
    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.
    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined
    objects and unknown namespaces.

  • How can you make one button preform different actions in Xcode?

    How can you make one button "preform a click" and "orderfront"? Is that possible? Because what I am doing is making a welcome window to my application for Mac OS X 10.6, and I have two buttons in that window, one says "Connect" which connects a a WebView to a url and the other button opens up the main window. So how can I a make a button do multiple things at once??

    Ah - If you are just using bindings between various objects from Interface Builder, you can reduce your application code a bit (sometimes quite a bit), but there is only so far you can go. Typically variables and routines are defined in your application that Interface Builder hooks into, so that your application code (usually Objective-C, but can be others) can use these variables and routines to determine what is happening in the user interface.
    I'm not sure how up-to-date the project code is (or what programming code you are familiar with), but you can take a look at Apple's Cocoa Application Tutorial to see what is (usually) involved in creating an application.

  • Webview crash WebEngine load method - Win + Mac

    The code below crashes on Win 7 JavaFX 2.0 and Mac OS X 10.6 Java FX 2.0 EA
    On Win 7 32 bits under Java 7 it crashes in WebPane.dll
    On Mac OS X I get: Invalid memory access of location 0x170 rip=0x11e7c0d67
    The culprit is
    eng.load("https://graph.facebook.com/me/friends?access_token="+token); in the change listener.
        public static void main(String[] args) {
            Application.launch(args);
        @Override
        public void start(Stage primaryStage) {
         primaryStage.setTitle("Hello World");
             WebView view = new WebView();
            final WebEngine eng = view.getEngine();
            eng.load("https://graph.facebook.com/oauth/authorize?" + "client_id=" +
                   API_KEY +  "&"
                   + "redirect_uri=http://www.facebook.com/connect/login_success.html&type=user_agent&display=popup);
            final TextField locationField = new TextField("http://www.oracle.com/us/index.html");
            locationField.setMaxHeight(Double.MAX_VALUE);
            Button goButton = new Button("Go");
            goButton.setDefaultButton(true);
            EventHandler<ActionEvent> goAction = new EventHandler<ActionEvent>() {
                @Override public void handle(ActionEvent event) {
                    eng.load(locationField.getText().startsWith("http://") ? locationField.getText() :
                            "http://" + locationField.getText());
            goButton.setOnAction(goAction);
            locationField.setOnAction(goAction);
            eng.locationProperty().addListener(new ChangeListener<String>() {
                @Override public void changed(ObservableValue<? extends String> observable, String oldValue, String newValue) {
                    locationField.setText(newValue);
                        if (newValue.startsWith("http://www.facebook.com/connect/login_success.html")) {
                                           URLCodec codec = new URLCodec();
                            try {
                             String s = codec.decode(newValue);
                              String[] splits = s.split(",");
                             try {
                                 String json = s.substring(s.indexOf('#') + 1, s.length());
                                 System.out.println("JSON = " + json);
                                 String st = URLDecoder.decode(json, "UTF-8");
                                 System.out.println(st);
                                 String params[] = st.split("&");
                                 HashMap<String, String> parmsMap = new HashMap<String, String>();
                                 for (String param : params) {
                                  String temp[] = param.split("=");
                                  parmsMap.put(temp[0], java.net.URLDecoder.decode(temp[1], "UTF-8"));
                                 String token = parmsMap.get("access_token");
                                 System.out.println(token);
                                 eng.load("https://graph.facebook.com/me/friends?access_token="+token);
                             } catch (Exception e) {
                            } catch (DecoderException e) {
                             // TODO Auto-generated catch block
                             e.printStackTrace();
            GridPane grid = new GridPane();
            grid.setVgap(5);
            grid.setHgap(5);
            GridPane.setConstraints(locationField, 0, 0, 1, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.SOMETIMES);
            GridPane.setConstraints(goButton,1,0);
            GridPane.setConstraints(view, 0, 1, 2, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.ALWAYS);
            grid.getColumnConstraints().addAll(
                    new ColumnConstraints(100, 100, Double.MAX_VALUE, Priority.ALWAYS, HPos.CENTER, true),
                    new ColumnConstraints(40, 40, 40, Priority.NEVER, HPos.CENTER, true)
            grid.getChildren().addAll(locationField, goButton, view);
            Scene scene = new Scene(grid, 1024, 768);
    {code}
    Edited by: user10787071 on Oct 8, 2011 9:52 PM
    Edited by: user10787071 on Oct 8, 2011 9:53 PM
    Edited by: user10787071 on Oct 8, 2011 9:55 PM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   

    Created the following JIRA http://javafx-jira.kenai.com/browse/RT-17313?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel

  • How do i make WebView automatically load when using TakeStringURLFrom??

    I haven't added any code yet. I've WebKit, a Webview and a editable textbox where it takes the URL from. Normally it would require you to hit enter, but i would like it to just load it automatically. How do i do this? Please explain EXACTLY how! I would also like to know how instead of it using scrollers, i can make it just do like if you play a windowed game, u know, so u can still see it all. Also i would like to know how u make it stretch out when it enters fullscreen, please.

    Open Accounts preferences, click on the Login Items tab. Select entries and press Delete [-] to remove. Click on the Add [+] button to place an application into the list.
    Note that the more items in the list you load at startup the slower your startup time will be.

  • How to get a value given to a button in HTML using a href tag

    Hi,
    In my application I have loaded  html  content  in WebView. In the HTML file i have used a Button to which i have given some value in href tag as
    <a href="ButtonClick//testing/mysample">
    <input type="button" value="Click me" />
    </a>
    When i click the button i want to get the string "ButtonClick//testing/mysample" in my app..  But i do not want to use InvokeScript() on my webview.. Could anyone please give me a solution for this?..
    Thank you.

    The only way to interact with HTML content from WebView is using JavaScript. You can do this by invoking such scripts from your C# code (using InvokeScript) or embedding the JavaScript method into the button you are working with.
    But you need to know that if you intend to get a return value from your JavaScript code, you would need to use the InvokeScript.
    Here's an example of printing the value from your hyperlink without InvokeScript. But note that it only prints the value and can't return the value to your C# code without InvokeScript.
    string htmlContent = @"
    <html>
    <head>
    <script type='text/javascript'>
    function myFunction()
    document.getElementById('myResult').innerHTML = document.getElementById('myLinkConent').href.substring(6); //remove 'about:' from href string
    </script>
    </head>
    <body>
    <a id='myLinkConent' href='ButtonClick//testing/mysample'>
    </a>
    <input type='button' value='Click me' onclick='myFunction()'/>
    <p id='myResult'></p>
    </body>
    </html>";
    Let me know if this helps.
    Abdulwahab Suleiman

  • Problem in webview

    Hi,
    I'm a novice in Cocoa Obj-C progamming. I'm working on a simple tabbed web browser for my college project. According to the Apple documentation, "WebKit Objective-C Programming Guide", every webview contains its own backForward list by default, until it is explicitly set to NO as in [webView setMaintainsBackForwardList:NO];
    So, in my browser application, I set the view for every tabbed item as webview programatically. Now, I'm trying to move back and forth between the pages. So, I obtain the webview associated with the selected tabviewitem and get its associated view. I displayed the view name using NSLOG and it rightly says that the associated view as WebView. So, I added a line of code to navigate the pages visited previously by the webview. But, when I clicked the button associated with the action method to navigate to previously visited pages, nothing happens. No error too. The code for the action method is as follows:
    NSTabViewItem *currentTab = [theTabView selectedTabViewItem]; WebView *webView = [currentTab view]; [webView goForward:self];
    I don't know what I'm doing wrong? I even tried to add the urls to the backForwardList manually but the end result is the same. Is something undocumented in the documentation or am I missing something?
    I might have done something really silly but as I said, I'm a beginner in cocoa so I would like to request you to kindly bear the inconvenience and help me in this regard.
    thanks in advance.

    I have solved the problem! No worries guys! Thanks anyway

  • Is it possible to play audio and video files(urls) directly in webView ?

    Hello Everybody,
    I have implemented one article page in webView. The content of the that page is html file. There are some links for audio and video files. Is it possible to play that links directly in that webView by clicking them?
    Or is there any other way to play this files?
    Any kind of information on this topic is highly appreciated.
    Thanks,
    Pandit Pakhurde

    Is it important that the music come from a video, or are you just looking to listen to music in the background, while doing something else.  If the later, you can certainly play music from the Music App, Pandora, or iHeart Radio, etc., and with the music playing, tap your home button to go to your home page and open anything else you want and the music will continue.
    I don't have any videos to try out right now, but you try the same thing out and if the music continues, it works.  If it doesn't, it doesn't.

Maybe you are looking for