You must Sign In to post a response.
  • Category: ASP.NET

    Dynamic video - Video with counter and skip button

    Hi,

    For the video panel, I want to display the video (hosted in YouTube), counter and skip button (same like YouTube feature), and when a user clicks on skip or the video ends, the video panel will refresh and display the actual/another YouTube video. How I can achieve it?


    Thanks,
  • #767951
    Hi,

    If you want to play video's - Iframe play keyrole to play the video, if you want to play the youtube video then you have to pass the appropriate youtube URL in the src tag of javascript, like below


    $get("video").src = "//www.youtube.com/embed/" + url


    for more details refer below link.

    aspsnippets.com/Articles/How-to-play-YouTube-video-in-ASPNet-Application.aspx

    --------------------------------------------------------------------------------
    Give respect to your work, Instead of trying to impress your boss.

    N@veen
    Blog : http://naveens-dotnet.blogspot.in/

  • #767955
    Hi,

    I hope you are expecting YouTube videos inside your application along with next button which will change the video also,
    Before that we need to start with initial step that is adding Iframe in your application.


    <html>
    <body>
    <iframe src="http://www.youtube.com/embed/Video1"
    width="550" height="315" frameborder="0" allowfullscreen></iframe>
    </body>
    </html>


    Now Load the YouTube Api in Javascript like,



    var tag = document.CreateElement('script');
    tag.src = "//www.youtube.com/player_api";
    var ScriptTag = document.getElementByTagName('script');
    ScriptTag.parentNode.insertBefore(tag, ScriptTag);




    Create a global Function something like youTubeApi()
    Then create a Player object which the video gone run and then call back event.

    We can also make Vimeo with same Iframe event using froogaloop Script Library.

    Thanks,
    Mani

  • #767963
    Hi Manigandan.

    Facing error: Uncaught SyntaxError: missing ) after argument list

    Please let me know whats wrong in below code,

    <html>
    <script>
    var tag = document.createElement('script');
    tag.src = "https://www.youtube.com/iframe_api";
    var ScriptTag = document.getElementsByTagName('script')[0];

    ScriptTag.parentNode.insertBefore(tag, ScriptTag);

    var player;
    function onYouTubeIframeAPIReady() {

    player = new YT.Player('player', {
    height: '390',
    width: '640',
    videoId: 'video code',
    events: {
    'onReady': onPlayerReady
    }
    });
    }
    function onPlayerReady(event) {
    event.target.loadPlaylist(playlist: ['video code'],index:1,startSeconds:0,suggestedQuality:"large"):Void
    }
    </script>
    <body>
    <div id="player"></div>
    </body>
    </html>

    Thanks in Advance....


  • Sign In to post your comments