Warning
We no longer support this SDK for Player integration on iOS environments. Please use the new iOS SDK documented here.
Dailymotion Player SDK for iOS in Swift
License: MIT License
Warning
We no longer support this SDK for Player integration on iOS environments. Please use the new iOS SDK documented here.
How to make video dailymotion in native app swift autoplay?
there a way to get the content media item ? I want to implement the cast to a Chromecast using this lib, but I am not sure if I can get some media item to send to cast in the chromecast
Looking at the documentation for both iOS and Android, there is some inconsistency. On Android, they are allowed to set the full screen either true or false with
setFullScreenButton(Boolean)
But not on iOS. On iOS, it's only toggleFullscreen()
which doesn't let you play with the boolean value at all.
Wondering if there is any work around?
I have done a sample project with the below parameters and it's working correctly. After a month I tried the same parameters is not working and the video still starts from 0
let parameters: [String: Any] = [
"fullscreen-action": "trigger_event",
"logo": "false",
"sharing-action": "trigger_event",
"start": Int(25)
]
let controller = DMPlayerViewController(parameters: parameters)
controller.delegate = self
return controller
}()
On iOS 12 and 13, I am not able to play videos with this latest version.
When i start play video in iOS >= 11.4 it's play fine.
When i start play video in iOS 11.2 and 10.3 it's didn't start play.
For test i use demo app.
override func viewDidLoad() {
super.viewDidLoad()
setupPlayerViewController()
playerViewController.load(videoId: "x4r5udv", params: "{ \"autoplay\": true }")
}
or
fileprivate lazy var playerViewController: DMPlayerViewController = {
let parameters: [String: Any] = [
"fullscreen-action": "trigger_event",
"sharing-action": "trigger_event",
"autoplay": true
]
let controller = DMPlayerViewController(parameters: parameters)
controller.delegate = self
return controller
}()
I just download your example project. I am able to load video but there is no user interaction. I try to click on pause / fullscreen / share, nothing happens.
I'm facing the same problem in my project using your POD !
Since I can't click on buttons, they disappear, when I try to show them again (by many clicks), this is what happen :
The view is broken.
Is it possible call an method to enable picture-in-picture without to click on the button of the player?
All is in the title
When we embed dailymotion iframe inside a webView, the vertical scroll on the dailymotion video is not working.
Hi team,
How do I trigger fullscreen with default player of iOS system? Then the default player control of iOS system will appear instead of Dailymotion player control.
Thanks.
Hi..
when, i' am pod install, appear error [!] Unable to find a specification for DailymotionPlayerSDK
.
this full my pod file
# Uncomment the next line to define a global platform for your project
# platform :ios, '9.0'
target 'DailyMotion' do
# Comment the next line if you're not using Swift and don't want to use dynamic frameworks
use_frameworks!
pod 'DailymotionPlayerSDK'
target 'DailyMotionTests' do
inherit! :search_paths
# Pods for testing
end
target 'DailyMotionUITests' do
inherit! :search_paths
# Pods for testing
end
end
I have used new swift library. but not getting current position of video.
can't get volume change event in the demo
func player(_ player: DMPlayerViewController, didReceiveEvent event: PlayerEvent) {
switch event {
case .namedEvent(let name, let data) where name == "volumechange":
print(data);
default:
break
}
}
#6 the exemple if you move the load from the play function in the setupPlayerViewController the video does not load, I get a black view.
This can reproduce the way I am handling in my app. #
For now this SDK is compliant but not migrated yet on swift4.
I am making video player in swift. I add some custom buttons and functionality for standard video player: 1. Playing video from URL (server) 2. Showing indicator while loading video like in VK 3. Add custom buttons to control (stop, pause buttons) and its working fine. I'm trying to implement custom view on player like below screen shot and play in custom duration in loop.
I need this type of view on video player
I can't understand how I can implement my tasks(For video url) there. Can you give some advice, which is the better way to do this?
Is possible to hide/show fullscreen button by another button or event?
Hi all,
I been working in a project where we have to use Daily Motion player in a iOS and Android app. I'll focus only in iOS here.
The app is targeted to iOS 14.5 and it use SwiftUI to compose user interface.
I'm getting several problems to handle Daily Motion player using SwiftUI, specially to manage when and how to stop or continue playing a video.
I did a sample project here. That project can be used to explore some of these issues.
First one is related to initializer.
There are some params like autoplay
that never work. The video always start playing, even if I try to force it to stop after load
callback.
Second is related to lifecycle.
There's no way to stop playing after a view disappear or another view been presented over another. Even using dismantleUIViewController
from UIViewControllerRepresentable
, the player doesn't respond to playback commands and sometimes, its reference is lost.
I kept this sample simple as possible to ask you help to figure out what I have to do to make it more functional for SwiftUI apps.
Thanks
I want to add set parameters like android:
setExtraParameters("ui-logo=false&ui-start-screen-info=false&sharing-enable=false&endscreen-enable=false");
Hi, Guys
I add these code in ViewController.swift
of your Demo Project
override func viewDidDisappear(_ animated: Bool) {
super.viewDidDisappear(animated)
playerViewController.pause()
}
override func viewDidAppear(_ animated: Bool) {
super.viewDidAppear(animated)
playerViewController.play()
}
And stay in ViewController2.swift
for 5 seconds, then come back, the video can not play again,
except seek duration time or reload.
Do you know what happened?
Hello
I have an issue with the "qualitiesavailable" event. Every time I am using it, the only quality returned is 144P. I think it may be the preroll's quality. But, when the media starts, the "qualitiesavailable" is not called.
Is there a proper way to get the available qualities for a video and change the quality, without using the Dailymotion controls ? (I think the only way to do this is to reload the video, using the "start" and "quality" playerParameters)
Thanks;
Best regards,
Alexis
After entering Fullscreen, dragging down stops the videos, instead of resizing it.
let parameters:[String:Any] = ["controls": 1]
let playerView = DMPlayerViewController(parameters: parameters)
addChildViewController(playerView)
playerView.view.frame = tableHeader.bounds
playerView.delegate = self
playerView.load(videoId: movie.VId!)
playerView.play()
I implement native controls for dailymotion video player. I've faced difficulties with ads. There is no flags for checking if ads are playing. Can you implement this? I know there are ads events and I can implement this on my side, but it will be useful for other sdk users.
Here is the scenario:
1/ Launch a viewController having a Dailymotion player and an audio player.
2/ Start the Dailymotion player
3/ Start the audio player
-> The Dailymotion video is paused but sometimes the play button is not changed and still have pause image in place of play.
To load a simple video we've to pass video id
But in my, application want to play videos from the playlist.
URL is something like this.
https://www.dailymotion.com/embed/playlist/{videoid}?autoplay=1&mute=1
I can't seem to be able to install via cocoapods. Is there pod file entry than the one in the documentation?
I'm using DMPlayerViewController in full screenmode and start it via a present command, so modal.
All's good, but how do I close now this full screen modal ?
The little full screen icon doesn't do anything, no event sent in the delegate, there is no X button or anything, so, how do I close it ?
Android has a hardware back, we don't. Any other idea except me adding a X button in code in your controller?
When we select the settings of the player and after we close it, we loose the control of the player and we can't have the control buttons anymore.
Hello,
I am integrating it with Swift 3.2 and am facing a strange issue. When I connect the headphone then it will stop to playing the video or sometime video is playing but no sound come in headphone. When I disconnect the headphone then it will remain in pause state.
Any suggestion?
For live videos with DVR, the duration is not available. On iOS we only receive the event with infinite duration:
"event=durationchange&duration=Infinity"
At the same time on Android we receive seekable duration with concrete value for the same video, like this:
"event=durationchange&duration=1000.12"
We have tested with different videos and have the same problem for all of them.
It used to be ok last week.
Thanks.
I would like to have multiple video instance in a horizontal UICollectionView which keep the last playing state, something like the Home screen in dailymotion iOS app downloadable from App store. User should be able to continue from the previous fetch video.
How can we do this? I don't see any sample from the sample code
What have been done:
I have tried to put DMPlayerViewController view as a view in the collection view cell.
Whenever the list is populated,
playerViewController?.load(videoId: videoId, params: "{ \"autoplay\": false }", completion: nil)
will be triggered for each cells.
Whenever the screen is loaded with the collection view cells, these are the logs produced with
Code:
public func player(_ player: DMPlayerViewController, didReceiveEvent event: PlayerEvent) {
logger.log(message: "Player event \(event)", LoggingOption: .debug)
switch event {
case .timeEvent(name: let name, time: let time):
logger.log(message: "Player event timeEvent \(name) time \(time)", LoggingOption: .debug)
case .namedEvent(name: let name, data: let data):
logger.log(message: "Player event namedEvent \(name) data \(data)", LoggingOption: .debug)
case .errorEvent(error: let error):
logger.log(message: "Player event errorEvent \(error)", LoggingOption: .debug)
}
}
Result:
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "scalemodechange", data: Optional(["scaleMode": "fit"]))
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent scalemodechange data Optional(["scaleMode": "fit"])
📖
XXDailyMotionPlayer.playerDidInitialize(_:)
playerDidInitialize <DailymotionPlayerSDK.DMPlayerViewController: 0x13679d3f0>
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "apiready", data: nil)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent apiready data nil
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "volumechange", data: Optional(["volume": "1"]))
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent volumechange data Optional(["volume": "1"])
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event timeEvent(name: "videochange", time: 87.0)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event timeEvent videochange time 87.0
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "playback_ready", data: nil)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent playback_ready data nil
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "playback_ready", data: nil)
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent playback_ready data nil
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "subtitlesavailable", data: Optional(["subtitles[]": "en"]))
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent subtitlesavailable data Optional(["subtitles[]": "en"])
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent(name: "subtitlechange", data: Optional(["subtitle": "-1"]))
📖
XXDailyMotionPlayer.player(_:didReceiveEvent:)
Player event namedEvent subtitlechange data Optional(["subtitle": "-1"])
I have a custom play pause button which will trigger
dmPlayerViewController.play()
or dmPlayerViewController.pause()
Whenever I tapped on the play button, I always saw this error in the logs:
Player event namedEvent(name: "playback_resolution", data: Optional(["status": "rejected", "reason": "rejected_inactive_tab"]))
What could be the reason for this error?
In the documentation, embed multiple players only appears for web.
How can we do this for iOS?
Thanks
When you navigate to the next video, the previous video continues to play in the background. The player stop method has already been called in the viewwilldisappear method. The player is still playing a video in the background.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.