Skip to content

Commit

Permalink
Merge pull request #968 from sarbagyastha/develop
Browse files Browse the repository at this point in the history
Support for multiple video in single page for web + Refinements
  • Loading branch information
sarbagyastha authored Aug 3, 2024
2 parents e83fd21 + 6e7a86f commit 13a9d17
Show file tree
Hide file tree
Showing 24 changed files with 515 additions and 435 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/web-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,4 @@ jobs:
- uses: subosito/flutter-action@v2
- uses: sarbagyastha/flutter-gh-pages@main
with:
workingDir: packages/youtube_player_iframe/example
baseHref: /youtube_player_flutter/
workingDir: packages/youtube_player_iframe/example
5 changes: 5 additions & 0 deletions packages/youtube_player_iframe/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
# Changelog
## 5.1.4
**Aug 3, 2024**
- Bumps dependency to latest version.
- Fixes issue where only one of player would initialize at a time in web.

## 5.1.3
**Jul 1, 2024**
- Bumps dependency to latest version.
Expand Down
15 changes: 8 additions & 7 deletions packages/youtube_player_iframe/assets/player.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

<body>
<div class="embed-container">
<div id="player"></div>
<div id="<<playerId>>"></div>
</div>

<script>
Expand All @@ -52,7 +52,7 @@
var timerId;

function onYouTubeIframeAPIReady() {
player = new YT.Player("player", {
player = new YT.Player("<<playerId>>", {
host: host,
playerVars: <<playerVars>>,
events: {
Expand Down Expand Up @@ -120,10 +120,10 @@
function sendPlatformMessage(message) {
switch(platform) {
case 'android':
YoutubePlayer.postMessage(message);
<<playerId>>.postMessage(message);
break;
case 'ios':
YoutubePlayer.postMessage(message, '*');
<<playerId>>.postMessage(message, '*');
break;
case 'web':
window.parent.postMessage(message, '*');
Expand All @@ -132,11 +132,12 @@
}

function sendMessage(key, data) {
var message = {}
message[key] = data
var message = {};
message[key] = data;
message['playerId'] = '<<playerId>>';
var messageString = JSON.stringify(message);

sendPlatformMessage(messageString)
sendPlatformMessage(messageString);
}

function getVideoData() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ android {

defaultConfig {
applicationId "np.com.sarbagyastha.youtube_player_iframe_example"
minSdkVersion 19
minSdkVersion flutter.minSdkVersion
targetSdkVersion 34
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
<key>CFBundleVersion</key>
<string>1.0</string>
<key>MinimumOSVersion</key>
<string>11.0</string>
<string>12.0</string>
</dict>
</plist>
2 changes: 1 addition & 1 deletion packages/youtube_player_iframe/example/ios/Podfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Uncomment this line to define a global platform for your project
# platform :ios, '11.0'
# platform :ios, '12.0'

# CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
LastUpgradeCheck = 1430;
LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
Expand Down Expand Up @@ -354,7 +354,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down Expand Up @@ -436,7 +436,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = YES;
ONLY_ACTIVE_ARCH = YES;
SDKROOT = iphoneos;
Expand Down Expand Up @@ -485,7 +485,7 @@
GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE;
GCC_WARN_UNUSED_FUNCTION = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
IPHONEOS_DEPLOYMENT_TARGET = 11.0;
IPHONEOS_DEPLOYMENT_TARGET = 12.0;
MTL_ENABLE_DEBUG_INFO = NO;
SDKROOT = iphoneos;
SUPPORTED_PLATFORMS = iphoneos;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1430"
LastUpgradeVersion = "1510"
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
Expand Down
Loading

0 comments on commit 13a9d17

Please sign in to comment.