• 02-12-2020, 04:03:31
    #1
    Üyeliği durduruldu
    https://www.jwplayer.com/developers/...wnload-button/
    linkteki sayfadan playerime indirme butonu eklemeye çalıştım

    ama kodlar nereye eklenecek bilmiyorum

    üstadlar yardım ederse çok sevinirim
  • 02-12-2020, 05:55:06
    #2
    Üyeliği durduruldu
    kimse bilmiyor mu?
  • 02-12-2020, 07:04:52
    #3
    kod zaten paylasilmis
    // Set up the playerconst playerInstance = jwplayer('player').setup({  playlist: 'https://cdn.jwplayer.com/v2/media/8L4m9FJB'});
    const buttonId = 'download-video-button';const iconPath = 'assets/download.svg';const tooltipText = 'Download Video';
    // Call the player's `addButton` API method to add the custom buttonplayerInstance.addButton(iconPath, tooltipText, buttonClickAction, buttonId);
    // This function is executed when the button is clickedfunction buttonClickAction() {  const playlistItem = playerInstance.getPlaylistItem();
      // Create an anchor element  const anchor = document.createElement('a');
      // Set the anchor's `href` attribute to the media's file URL  const fileUrl = playlistItem.file;  anchor.setAttribute('href', fileUrl);
      // set the anchor's `download` attribute to the media's file name  const downloadName = playlistItem.file.split('/').pop();  anchor.setAttribute('download', downloadName);
      // Set the anchor's style to hide it when it's added to the page  anchor.style.display = 'none';
      // Add the anchor to the page  document.body.appendChild(anchor);
      // Trigger a click event to activate the anchor  anchor.click();
      // Remove the anchor from the page, it's not needed anymore  document.body.removeChild(anchor);}
  • 02-12-2020, 07:13:45
    #4
    Üyeliği durduruldu
    suleymanyaldiz adlı üyeden alıntı: mesajı görüntüle
    kod zaten paylasilmis
    // Set up the playerconst playerInstance = jwplayer('player').setup({  playlist: 'https://cdn.jwplayer.com/v2/media/8L4m9FJB'});
    const buttonId = 'download-video-button';const iconPath = 'assets/download.svg';const tooltipText = 'Download Video';
    // Call the player's `addButton` API method to add the custom buttonplayerInstance.addButton(iconPath, tooltipText, buttonClickAction, buttonId);
    // This function is executed when the button is clickedfunction buttonClickAction() {  const playlistItem = playerInstance.getPlaylistItem();
      // Create an anchor element  const anchor = document.createElement('a');
      // Set the anchor's `href` attribute to the media's file URL  const fileUrl = playlistItem.file;  anchor.setAttribute('href', fileUrl);
      // set the anchor's `download` attribute to the media's file name  const downloadName = playlistItem.file.split('/').pop();  anchor.setAttribute('download', downloadName);
      // Set the anchor's style to hide it when it's added to the page  anchor.style.display = 'none';
      // Add the anchor to the page  document.body.appendChild(anchor);
      // Trigger a click event to activate the anchor  anchor.click();
      // Remove the anchor from the page, it's not needed anymore  document.body.removeChild(anchor);}

    hocam işte kodu nasıl ve nereye ekliyorum orasını bilmiyorum

    player js sini sunucuya yükledim

    ama bu kod nereye eklenecek onu bilmiyorum