RadMediaPlayer with enabled YouTube playlist throws 410(gone) response

Thread is closed for posting
3 posts, 0 answers
  1. Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 04 Jun 2015 Link to this post

    The current version of RadMediaPlayer depends on YouTube API 2.0, however YouTube deprecated the YouTube API v2.0 – Playlists which caused the RadMediaPlayer’s YouTube Playlist functionality stop working and the page to return 410 response. More information you can find here:
    https://developers.google.com/youtube/2.0/developers_guide_protocol_playlists

    For the official Q2 2015 release we will migrate the media player to the latest 3.0 version of the YouTube API:
    https://developers.google.com/youtube/v3/getting-started

  2. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 08 Jun 2015 Link to this post

    Hello,

    As a solution until the new version is published, the items from the Playlist can be added in the code behind. Find the attached page in this post, for example approach.

    The workaround is to handle the PreRender event of the MediaPlayer, request the Youtube Playlist list using their new API and then populate the MediaPlayer list.
    To prevent old API from calling, you need to remove the playlist settings from your markup, and add empty MediaPlayerVideoFile in the Playlist.
    <telerik:RadMediaPlayer ID="RadMediaPlayer1" runat="server" Height="360px" Width="640px"
        OnPreRender="RadMediaPlayer1_PreRender">
        <Playlist>
            <telerik:MediaPlayerVideoFile>
            </telerik:MediaPlayerVideoFile>
        </Playlist>
        <PlaylistSettings />
    </telerik:RadMediaPlayer>

    And on the PreRender event, populate the list:
    protected void RadMediaPlayer1_PreRender(object sender, EventArgs e)
    {
        AddYoutubeCreatePlaylist(sender as RadMediaPlayer, "PLvmaC-XMqeBaRgdM2nVNSM-0SSG_xbjSN");
    }

    The second parameter is the Playlist id. And you will find working example in the attached page.

    In the Code-Behind of the page you will find property called YoutubeApiKeyResolved. Check the comments, and make sure it returns your API key.

    In order to obtain API key. You will need to log into your google account:
    https://console.developers.google.com/project/radmediaplayer/apiui/apiview/youtube/overview
    Find the "YouTube Data API v3" section and Enable the API.

    Then in the Credentials section you will find  "Public API access" click on the Create New Key, and create Server Key.

    Once the Q2 2015 comes available, you will not need the workaround anymore (but it will still work). You will just need to set your key in the web.config (directly in the markup of the page)

    Regards,
    Vasil
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Eyup
    Admin
    Eyup avatar
    3015 posts

    Posted 30 Jun 2015 Link to this post

    Update: UI for ASP.NET AJAX Q2 2015

    The improvement is now integrated in RadMediaPlayer and there is no need to implement any other additional logic. You still need to add your own YouTube key in the web.config file:

    <appSettings>
      ...
      <add key ="YoutubeApiKey" value="YourKeyGoesHere"/>
    </appSettings>

     


    If you have difficulties obtaining the key, you can generate your own key using the steps here by creating a new google project:
    https://developers.google.com/youtube/registering_an_application

    Expand the APIs & auth option in the application tree - there you can enable the YouTube API in the APIs subsection and Create your Public API access Server key in the Credentials subsection.

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top