I have a simple video player that streams .webm video files and a Gridview underneath which holds all of my files and Select buttons.

In my aspx page I have a javascript function `vidSwap(vidURL)` which is supposed to change the source of the streaming video. It works perfectly all in HTML when I use normal tables, but these gridview tables are still confusing for me.

Is there a clever way to wire the select button in gridview to perform a video swap on the player without reloading the page?

My XML File (Data):

```
<?xml version="1.0" encoding="utf-8" ?>
<root>
  <video name="2.webm" location="http://10.0.8.168/media/" />
  <video name="redcliff450.webm" location="http://10.0.8.168/media/" />
  <video name="sunflower.webm" location="http://10.0.8.168/media/" />
  <video name="Elephants_Dream.webm" location="http://10.0.8.168/media/" />
</root>

```

My ASP File:

```
%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="VideoStreaming.index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Streaming Video</title>
    <script type="text/javascript">
        function vidSwap(vidURL) {
            var myVideo = document.getElementsByTagName('video')[0];
            myVideo.src = vidURL;
            myVideo.load();
            myVideo.play();
        }
    </script>

    <script src="/build/jquery.js" type="text/javascript"></script> 
    <script src="/build/mediaelement-and-player.min.js" type="text/javascript"></script>
    <link rel="stylesheet" href="/build/mediaelementplayer.min.css" />
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table style="width:100%;">
            <tr>
                <td>
                    <video width="640" height="360" id="Video1" src="http://10.0.8.168/media/2.webm" 
                    controls="controls" preload="none">
                    </video>
                </td>
            </tr>
            <tr>
                <td>
                    <asp:XmlDataSource ID="XmlDataSource1" runat="server" DataFile="~/App_Data/data.xml" />
                    <asp:GridView ID="GridView1" runat="server" DataSourceID="XmlDataSource1" 
                        AutoGenerateColumns="False" AllowPaging="True" CellPadding="4" 
                        ForeColor="#333333" GridLines="None" 
                        onselectedindexchanged="GridView1_SelectedIndexChanged">
                        <AlternatingRowStyle BackColor="White" />
                        <Columns>
                            <asp:CommandField SelectText="Play" ShowSelectButton="True" />
                            <asp:BoundField DataField="name" HeaderText="name" 
                                SortExpression="name" />
                        </Columns>
                        <EditRowStyle BackColor="#2461BF" />
                        <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                        <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                        <RowStyle BackColor="#EFF3FB" />
                        <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                        <SortedAscendingCellStyle BackColor="#F5F7FB" />
                        <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                        <SortedDescendingCellStyle BackColor="#E9EBEF" />
                        <SortedDescendingHeaderStyle BackColor="#4870BE" />
                    </asp:GridView>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

```