Skip to content

Commit

Permalink
feat(players): Add support for YouTube
Browse files Browse the repository at this point in the history
  • Loading branch information
schdck committed Apr 22, 2020
1 parent b5624d1 commit a7e8ceb
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 1 deletion.
37 changes: 37 additions & 0 deletions RemoteFlix.Base/Players/PlayerYoutube.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
using RemoteFlix.Base.Classes;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RemoteFlix.Base.Players
{
public class PlayerYoutube : BasePlayer
{
public override string Id => "youtube";
public override string Name => "YouTube";

public override IntPtr? GetHandle()
{
return null;
}

public override IEnumerable<PlayerCommand> Commands => new PlayerCommand[]
{
new PlayerCommand("play_pause", "Play / Pause", "k"),
new PlayerCommand("volume_up", "Volume UP", "{UP}"),
new PlayerCommand("volume_down", "Volume Down", "{DOWN}"),
new PlayerCommand("next_video", "Next video", "+n"),
new PlayerCommand("previous_video", "Previous video", "+p"),
new PlayerCommand("mute_unmute", "Mute / Unmute", "m"),
new PlayerCommand("enter_full_screen", "Full screen", "f"),
new PlayerCommand("exit_full_screen", "Exit full screen", "{ESC}"),
new PlayerCommand("go_back", "Go back", "{LEFT}"),
new PlayerCommand("go_forward", "Go forward", "{RIGHT}"),
new PlayerCommand("faster", "Go faster", ">"),
new PlayerCommand("slower", "Go slower", "<"),
new PlayerCommand("closed_captions", "Enable / Disable CC", "c"),
};
}
}
1 change: 1 addition & 0 deletions RemoteFlix.Base/RemoteFlix.Base.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
<Compile Include="Players\PlayerNetflix.cs" />
<Compile Include="Players\PlayerNetflixChrome.cs" />
<Compile Include="Players\PlayerVlc.cs" />
<Compile Include="Players\PlayerYoutube.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="RemoteFlixPlayers.cs" />
<Compile Include="RemoteFlixServer.cs" />
Expand Down
3 changes: 2 additions & 1 deletion RemoteFlix.Base/RemoteFlixPlayers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ public static class RemoteFlixPlayers
new PlayerNetflix(),
new PlayerNetflixChrome(),
new PlayerVlc(),
new PlayerButter()
new PlayerButter(),
new PlayerYoutube()
};
}
}

0 comments on commit a7e8ceb

Please sign in to comment.